user3954561
user3954561

Reputation:

Copy A form to use in the same project

I need to have 8 forms of the same format within the same project

I dont really want to specifically place all the buttons etc in each of them

Is there a way i could copy and paste the format and then change all the button names etc?

The program is a flight booking system so for different flights on the same plane type i need multiple forms

Upvotes: 2

Views: 27048

Answers (2)

Abdellah OUMGHAR
Abdellah OUMGHAR

Reputation: 3745

To duplicate a Windows Form, you have to do these simple steps :

1- Open the folder project in File Explorer.

2- Copy the three files, .vb, .Designer.vb, .resx of the form that you want to copy.

3- Rename the files with the name you want.

4- Open the file with a text editor for example Notepad++.

5- Modify the Class name in the .vb and .Designer.vb file.

6- Include those files in the project.

Below an example demo :

enter image description here

Upvotes: 17

Beldi Anouar
Beldi Anouar

Reputation: 2180

Ok you can do copy past from your form1 ,a form CopyOfForm1 shoud be created .

  • you change name "form2" instead of "CopyOfForm1"
  • Change name of class "form2" instead of "CopyOfForm1"
  • In CopyOfForm13Desiner.vb you must also change name of class "form2" instead of "CopyOfForm1"

Have a look at this Gif picture :

enter image description here

Upvotes: 4

Related Questions