How to work on a copy of a windows form.

Hi,

I have a two forms. the second one is 70 percent identical to the first. I don't want to recreate the form instead wish to copy the same form rename it then work on it. when I do this it is not possible to simultaneously work on both the forms.

I am getting errors.

Is this not possible in VB 2005

or what is the way to do it

thanks




Answer this question

How to work on a copy of a windows form.

  • Lgee212

    the copy and paste definitely helps me, to tell the actual application.

    The first I have is the enquiry form

    Second is the proposal form (similar to the quotation form)

    After this is the confirmation (for entering the details of the confirmation of the order)

    Here the proposal and confirmation forms are little similar but the confirmation form will be holding more information than proposal.

    I need to change many things in the code like instead of propid it should be cnfid etc.,

    However I was able to proceed by copying the controls of proposal form to a new blank windows form and even the code excluding the class declaration. and then made changes the way I wanted.

    Thanks for the reply.



  • SolarScott

    Is it Visual Inheritence that you are looking for

    Best regards,
    Johan Stenberg



  • byx45

    How copy-pasted form will help If 70% of forms is the same - any change in this 70% will need to be duplicated in second form. So what is good in copy-paste


  • jrcdude

    Hi!

    You need to create User Control and put there all that is the same. Then you can use this control in your forms just like TextBox or other controls.

    I don't understand about "simultaneously work on both the forms". If you need them to display same data - bind to the same data source. If you want that they both displayed on screen - use Show() instead of ShowDialog() - but this is not common practice to open multiple dialogs.


  • vodka

    There are three form files...

    myform.vb
    myform.designer.vb
    myform.resx

    After you rename the file for the form, open both of the .vb files and change the class name to match. If you don't do this, the IDE will get confused as to which is the original and which is the copy.

    Jonathan


  • Geoff Henry

    I'm not quite sure i understand the "its not possible to simulateously work on both forms"

    Is this at design time or runtime we are talking about

    Is there any specific error messages being shown

    If a large amount of design is common a user control may be the way to improve things as Sergey has mentioned.


  • How to work on a copy of a windows form.