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. 4 6059
mrmagoo wrote: 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.
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
Thanks!
"Chris" <no@spam.com> wrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl... mrmagoo wrote: 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.
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
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.
--
Dennis in Houston
"mrmagoo" wrote: Thanks!
"Chris" <no@spam.com> wrote in message news:ef**************@TK2MSFTNGP03.phx.gbl... mrmagoo wrote: 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.
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
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
--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD
Tel: 0870 080 2300
Fax: 0870 735 0011
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com... 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. -- Dennis in Houston
"mrmagoo" wrote:
Thanks!
"Chris" <no@spam.com> wrote in message news:ef**************@TK2MSFTNGP03.phx.gbl... > mrmagoo wrote: > > 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. > > > > > > 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Risto Heinonen |
last post by:
Hi.
I have a web page that has images and text. I can carefully select one
image and the on the right of the image and then copy & paste to Word.
Is it possible to make javascript do the same:...
|
by: Shyguy |
last post by:
I want to create two buttons on a form. One would allow the user to
Copy the contents of the current records memo field, the other would
allow them to print. I set up a report based on the memo...
|
by: Tlm |
last post by:
Hello All,
I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also
has a subform embedded in it (SubFrmC) The form's recordsource is based on a
table (TblA). SubFrmB's...
|
by: david |
last post by:
Hi,
I've been reading tons of posts on how to copy records, but to no
avail....i'm still stuck.
There are three tables: Main, Sub-Form1 & Sub-Form2
I have a form which displays some data....
|
by: davidgordon |
last post by:
Hi,
I need some pointers/help on how to do the following if it possible:
In my access db, I have the following:
Tables: Products, Sub-Assembly, Product-Pack
Table, Products
| |
by: Woody Splawn |
last post by:
I am somewhat new to VS.net in general. As a result I am prone to make
mistakes. When adding some new feature to a a form it would be nice if I
could back it up before trying something that might...
|
by: puzzlecracker |
last post by:
Given,
class X
{
//.....
private:
auto_ptr<Y> y;
};
|
by: Kaur |
last post by:
Hi, I have been successful copying a vba code from one of your posts on
how to copy and paste a record by declaring the desired fields that
needs to be copied in form's declaration and creating two...
|
by: phill86 |
last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |