TabControl OnClick Event (1 Viewer)

Topher

Registered User.
Local time
Today, 17:58
Joined
Apr 18, 2000
Messages
72
Hey there,

does anyone know how the tabcontrol onclick event works?? i've set up some code in the even but when i click the tab i want the code doesnt run - i dont even think its looking at the code at all.

- Topher
 

Jack Cowley

Registered User.
Local time
Today, 17:58
Joined
Aug 7, 2000
Messages
2,639
I am not a Tab expert but as far I as I can tell the On Click event refers to the Body of the page, not the tab itself.

Jack
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 17:58
Joined
Jun 16, 2000
Messages
1,954
I tend to use the OnChange event and then have blocks of code there like:

If MyTabCtl.Value = 1 Then
'some code
end if

If TabCtl27.Value = 2 Then
'some other code
end if

I think this could be done more elegantly with 'Select Case', but I'm quite happy with using if/then


Mike
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 17:58
Joined
Jun 16, 2000
Messages
1,954
Oh, one more thing - if you're going to do it like the above, make sure that you carefully design your form and put your tabs in the right order first, as inserting one in the middle later will mean you have to chop your code around.
 

Users who are viewing this thread

Top Bottom