Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form clone
Message
De
08/08/2005 11:54:40
 
 
À
08/08/2005 10:49:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Divers
Thread ID:
01039313
Message ID:
01039330
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Hilmar,

Try this:

Right-click on the Form in the Solution Explorer and choose "Copy". Then right-click on the Project and choose "Paste". Then, you probably want to rename the file (because it will call it "Copy of MyForm") ... just right-click on it to Rename it. Unfortunately, the IDE is still not smart enough to change any of the code in the Form class when you do this, so you'll need to open up the copied Form (in code view, not in designer view) and change the class name, which will still have the old Form's name). You'll need to change the class name, the constructor, and the a few properties in the generated code (this.Name and this.Text).

~~Bonnie



>I want to make an exact duplicate of a form, in order to make minor changes later.
>
>So far, I have fruitlessly tried:
>
>1) Save as, then add the duplicate to the project. The project only shows one of the forms.
>
>2) Make a new form, copy the entire code from the old form, and paste into the new one. The compiler gives an error message; as far as I remember, something like "the forms share the same resources".
>
>OK, there may be better alternatives, such as deriving from a class, and any other alternative suggestions are welcome, but I still want to know whether quickly cloning a form is possible.
>
>TIA,
>
>Hilmar.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform