Change tab control page programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Can anyone show me the correct syntax for changing a tab control to a
specific tab in response to a button's on_click event? The button is on a
separate form from the form that contains the tab control.

Many thanx,

Ripper T
 
You set the value of the tabcontrol to be the index of the page you want.
Note that the pageindex starts with 0 so the following will make the 2nd
page the current one:

me.MyTabCtl=1

Also, consider using the the name of the page itself to indirectly specify
the page index. Since page names rarely change but the order might if you
add something (or haven't finished designing the page). The following would
make the page named "pgOrders" the current page (regardless of the actual
index of pgOrders)

Me.MyTabCtl = me.MyTabCtl.Pages("pgOrders").PageIndex
 
Back
Top