Adding tab page to tab control dynamically - set focus ?

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi,

I am adding Tab pages to a Tab control dynamically via the following
statement...

Form1.TabControl1.Controls.Add(ThePage)

The next 2 statements also work...

ThePage.Name = some string
ThePage.Text = some string

However....

When I want to make the newly added page the active page....

I have tried...

ThePage.Select()
and
ThePage.Focus()
and
ThePage.BringToFront()

None of these work...

Any Ideas ?
 
Hi,

I am adding Tab pages to a Tab control dynamically via the following
statement...

Form1.TabControl1.Controls.Add(ThePage)

The next 2 statements also work...

ThePage.Name = some string
ThePage.Text = some string

However....

When I want to make the newly added page the active page....

I have tried...

ThePage.Select()
and
ThePage.Focus()
and
ThePage.BringToFront()

None of these work...

Any Ideas ?

Dim tp As New TabPage
tp.Text = "My TabPage"
Me.TabControl1.TabPages.Add(tp)
Me.TabControl1.SelectedTab = tp

Thanks,

Seth Rowe
 
Thanks, worked well !


rowe_newsgroups said:
Dim tp As New TabPage
tp.Text = "My TabPage"
Me.TabControl1.TabPages.Add(tp)
Me.TabControl1.SelectedTab = tp

Thanks,

Seth Rowe
 
Back
Top