Link to home
Start Free TrialLog in
Avatar of grwallace
grwallace

asked on

How do you get the PreviousTab in a tab control in vb.net

In VB6 we had

Private Sub SSTab1_Click(PreviousTab As Integer)

end sub

Can we get the previous tab in VB.Net, or is this something we have to set up manually?
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

I think we have to do it manually! At least I do it and I don't know another way.
Avatar of dhwanilshah
dhwanilshah

There are several events available on the Tab control, the most promising one is -

------------------------------------------------
Public Event Selecting(ByVal sender As Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs)
     Member of: System.Windows.Forms.TabControl
Summary:
Occurs before a tab is selected, enabling a handler to cancel the tab change.
------------------------------------------------

If the TabControlCancelEventArgs, contains the tab / index which is going to  be selected, then you can get the currently selected tab / index from the Tab control and the going-to-be-selected from the TabControlCancelEventArgs.
Avatar of grwallace

ASKER

I'm not sure how to extract the value from the TabControlEventsArg, but this looks like what I want
ASKER CERTIFIED SOLUTION
Avatar of dhwanilshah
dhwanilshah

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial