By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

Select Tab Page That Has Been Added At Runtime

P: 133
Hi Guys,

I add my tab pages at runtime, I am trying to select a tab from a sub.

This is how i generate my tabs
Expand|Select|Wrap|Line Numbers
  1.         Dim tp As New TabPage("User Management")
  2.         Dim f2 As New fmUserManagement
  3.         f2.TopLevel = False ' REQUIRED
  4.         f2.FormBorderStyle = Windows.Forms.FormBorderStyle.None ' optional
  5.         f2.Dock = DockStyle.Fill ' optional
  6.         tp.Controls.Add(f2)
  7.         f2.Show()
  8.         TabControl1.TabPages.Add(tp)
this does'nt select any tab...
Expand|Select|Wrap|Line Numbers
  1. AdminParent.TabControl1.SelectTab("User Management")
Jun 5 '10 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 7,872

The text you pass in the constructor is NOT the Name property. You need to set the Name property to the "User Management" string

Forget this:
When do you populate the tabs and when do you call select?
Jun 9 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.