If I create a form and add add a bunch of controls and code, etc to it, I
can see that Visual Studio adds all of the requisite "creation" code behind
the form.
If I wanted to create a 2nd copy of the exact form, how would I go about
that? Could I just copy the code from the first form, including the
Windows-generated code, and paste it in the code-behind of the 2nd form? I
see that there is a warning not to modify the code-behind using the code
editor, but to instead use the Form Designer. Does that mean what I ask is a
bad idea?
If so, what's the easiest way to add a 2nd form with exactly the same
controls, events, etc?
Thanks.
Chris - 12 May 2006 16:45 GMT
> If I create a form and add add a bunch of controls and code, etc to it, I
> can see that Visual Studio adds all of the requisite "creation" code behind
[quoted text clipped - 11 lines]
>
> Thanks.
No, your way will work fine. You could also just copy the .vb files for
it and add it to your new project. The warning is just, a warning, you
can make changes but if you do something incorrect the designer might
not work. Make sure to change the class name once you copy it.
Chris
mrmagoo - 12 May 2006 18:19 GMT
Thanks!
> > If I create a form and add add a bunch of controls and code, etc to it, I
> > can see that Visual Studio adds all of the requisite "creation" code behind
[quoted text clipped - 18 lines]
>
> Chris
Dennis - 13 May 2006 00:43 GMT
Everytime I try your approach, I seem to screw up the designer code somehow.
I have reverted to creating a new form then copying all the controls to it.

Signature
Dennis in Houston
> Thanks!
>
[quoted text clipped - 24 lines]
> >
> > Chris
Simon Verona - 13 May 2006 09:15 GMT
I just do it by copying and pasting the form, in the solutions explorer in
the designer. You just need to change the class name and the form name in
the initialisation code (it will come up as a compiler error so it's easy to
find).
HTH
Simon

Signature
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD
Tel: 0870 080 2300
Fax: 0870 735 0011
> Everytime I try your approach, I seem to screw up the designer code
> somehow.
[quoted text clipped - 35 lines]
>> >
>> > Chris