I have panel with few textboxes, datagridview, etc… – Panel1.
Also, I have TabControl with 3 TabPages (may be more) on which I would like to add that Panel1.
I don’t know is this good idea because of events which will be happen in tab pages and collecting data from textboxes. Will it be better do build one usercontrol instead of panel?
But, ok…
How to add that panel to tab pages?
I try:
Panel1.Location = New Point(50, 50)
TabControl1.TabPages(0).Controls.Add(Panel1)
Panel1.Location = New Point(60, 50)
TabControl1.TabPages(1).Controls.Add(Panel1)
Panel1.Location = New Point(70, 50)
TabControl1.TabPages(2).Controls.Add(Panel1)
But this, of course don’t work.
I am a huge fan of panels! And who doesn’t love tabs? I don’t believe you should have any issues with events, as long as they are setup correctly at the panel / control level.
A basic way to handle: