Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate a VB.NET form

Status
Not open for further replies.

sburden

Programmer
Dec 4, 2002
35
US
Hello,

I'm a newbie to VB.NET and I'm trying to figure out how to duplicate an existing form. My project consists of 4 forms. Forms 2 and 3 are nearly identical. I want to duplicate form 3 after form 2.

Thanks
 
You can use visual inheritance. Right click on your project/ Select Add / Select Add Inherited Form

It will then ask you what form you want to inherit and create a form base on the original

DotNetDoc
M.C.S.D.
---------------------------------------

Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb

-----------------------------------

If you can't explain it simply, you don't understand it well enough.
- A. Einstein





 
Hi sburden
You can do it in two ways
1) Copy you FORM2 in some other directory,Rename FORM2 to FORM3 ,Move this FORM3 to your project folder and add this form (this method will might give you error as FORM3 still have class as named as FORM 2,so you can change it in FORM3.VB
OR
2) Add a new form name it FORM3 ,expand all code means FORM2.VB and Select All the Code and copy it then open the FORM3 and paste the Code in it change the Class name to FORM3

Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top