[dba-VB] VB.Net 2005 copy a form

Charlotte Foust cfoust at infostatsystems.com
Wed Jul 2 18:34:39 CDT 2008


If you're really hot to copy a form (I've had a few that I didn't want
to recreate by copy and paste for very complex reasons), you can simply
copy the files for that form to someplace like a temp folder and rename
it.  Course, you have to go into the modules and make sure the rename
gets propagated throughout the class and designer code.  Then just use
Add Existing Item from the menu and browse to the class for your renamed
form.

Charlotte Foust 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, July 02, 2008 9:31 AM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] VB.Net 2005 copy a form

Hi William

That brings some relief - I thought I was missing something obvious.

I'll try your method next time.

/gustav

>>> wdhindman at dejpolsystems.com 02-07-2008 18:12 >>>
Gustav

...I never "copy" a form outright ...I found it cited as a bad practice
on a "best practices" list when I first got into vs5 ...it supposedly
led to all kinds of problems down the line ...my practice is to first
create a new form in VS and then to copy the contents of the original to
the new leaving what vs created alone ...I've not had any problems with
this (knock on wood) and its "almost" as easy as copying and renaming a
form.

...I assumed ms would have fixed such an obvious problem in vs8 but then
I've been assuming such in Access since A97 days ...and what do I have
to show for such faith? ...a ribbon! :(

William
"My friends, we live in the greatest country in the world. Please join
with me as we try to change it." Obama


--------------------------------------------------
From: "Gustav Brock" <Gustav at cactus.dk>
Sent: Wednesday, June 25, 2008 3:34 AM
To: <dba-vb at databaseadvisors.com>
Subject: Re: [dba-VB] VB.Net 2005 copy a form

> Hi William
>
> I have done so. Same issue. Or am I missing something?
>
> /gustav
>
>>>> wdhindman at dejpolsystems.com 25-06-2008 05:19 >>>
> ...upgrade to vs2008 :)
>
> William
> "Sen. McCain will bring a lifetime of experience to the campaign...
Sen.
> Obama will bring a speech that he gave." Hillary Clinton
>
> --------------------------------------------------
> From: "Gustav Brock" <Gustav at cactus.dk>
> Sent: Tuesday, June 24, 2008 12:09 PM
> To: <dba-vb at databaseadvisors.com>
> Subject: Re: [dba-VB] VB.Net 2005 copy a form
>
>> Hi John
>>
>> You can copy and paste the .cs file in the Solution Explorer pane.
The
>> copy will be renamed and you can rename that to what you want.
>>
>> However, if you in the Properties pane later rename the copy of form
to
>> the new name, I've found that the refactoring mechanics will rename
>> references to your form not only in the .Designer.cs file (correct)
but
>> also in the original .Designer.cs file (really nasty)! What do others
do?
>>
>> /gustav
>>
>>>>> Johncliviger at aol.com 24-06-2008 17:21 >>>
>> Hi All
>>
>> How do you copy a Form in VB.Net 2005?  I have a form with 100+
controls.
>> I  need a very similar form and It seems a real drag to type that lot
again.
>> Any sugesstions?
>>
>> TIA
>>
>> johnc



_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list