Load form on TabControl (1 Viewer)

Surka

IT dude
Local time
Today, 16:02
Joined
Aug 5, 2013
Messages
41
Dear all,
I am working on a VB .Net project, with Visual Studio 2013.
Currently I am using Windows Forms with the following design:

  • MainForm with a MenuStrip and a TabControl.
  • newUserForm, with controls in it to create a new user.
I want to load the newUserForm on the TabContro, and I read I have 2 options, and 2 questions came out:

1 - Copy an paste code from newUserForm to the MainForm, and copy and paste controls to the TabControl.
Should I paste the code from newUserForm_Load into MainForm_Load or into TabControl_Click?

2 - Make of newUserForm a control.
How do I convert the form into a Control?
Also, keep in mind that I am on the beginning of the project: is copy and paste a good solution?

I hope to get help on this,

Thanks.
 

vedika

Registered User.
Local time
Tomorrow, 00:32
Joined
Jan 24, 2019
Messages
11
You handle the Click event when you to do something when the user clicks something. That's most usual for a Button but might be logical for some other controls too. Doing something when the user clicks a TabControl would be unusual to say that least. SelectedIndexChanged might be more usual. But surely if you would do something on the Load event of a form then what you want to do is initialisation so you will only want to do it when you first add a TabPage. If so then that's got nothing to do with clicking the TabControl.
 

Users who are viewing this thread

Top Bottom