[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

copying tabpage and all its items

hi all,

I have a tabpage with several labels and textboxes, which are filled by results of a MySql-query.  
For each row of the result of that query I need to create another tabpage, with the same characteristics as the first one.

thanks in advance
ardixiv
0
ardixiv
Asked:
ardixiv
  • 2
1 Solution
 
RobertRFreemanCommented:
Create a usercontrol that has all your tab elements on it.

dim row as datarow
Dim tp as System.Windows.Forms.TabPage
Dim uc as MyTabPageUserControl
for each row in dataset1.mytablename
     tp = New System.Windows.Forms.TabPage
     uc = New MyTabPageUserControl
     uc.TextBox1.Text = "test"
     tp.controls.add(uc)
     uc.dock =  = System.Windows.Forms.DockStyle.Fill
     Me.TabControl1.Me.TabControl1.TabPages.Add(tp)
next

For databinding/adapter info:
http://vsnetdatabinding.blogspot.com/
0
 
RobertRFreemanCommented:
Me.TabControl1.Me.TabControl1.TabPages.Add(tp)

should be

Me.TabControl1.TabPages.Add(tp)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now