|
-
Jan 26th, 2009, 12:48 PM
#1
Thread Starter
Lively Member
Tab order
Hi guys a quick question
I just want to ask how you code in visual basic the following scenario.
Example i have four(4) tabpage in a tab control
when the selected tabpage = to my Inventory tab page it will call a certain function else it will end the process..
Something like that po..
Thanks
-
Jan 26th, 2009, 01:01 PM
#2
Re: Tab order
Handle the TabControls SelectedIndexChanged event. You can evaluate the SelectedTab or SelectedIndex properties to know what Tab was selected.
-
Jan 26th, 2009, 01:04 PM
#3
Hyperactive Member
Re: Tab order
Can you clarify yours question.
Did you mean
When (Selected Tabpage) is equal to (to)
When (Selected Tabpage) = (to)?
If yes what is 'to'?
-
Jan 26th, 2009, 02:47 PM
#4
Re: Tab order
Well, lets say your Inventory tab page is named InventoryTab you could do this in the SelectedIndexChanged event handler of your tab control:
vb Code:
If MyTabControl.SelectedTab.Name = "InventoryTab" Then
'Run your method here
End If
That help?
-
Jan 26th, 2009, 08:17 PM
#5
Re: Tab order
 Originally Posted by chris128
Well, lets say your Inventory tab page is named InventoryTab you could do this in the SelectedIndexChanged event handler of your tab control:
vb Code:
If MyTabControl.SelectedTab.Name = "InventoryTab" Then
'Run your method here
End If
That help?
You should use the objects themselves instead of strings to identify them wherever possible:
vb.net Code:
If MyTabControl.SelectedTab Is Me.InventoryTab Then
-
Jan 27th, 2009, 05:12 AM
#6
Re: Tab order
Oh right, cool thanks for the tip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|