On click on tab control

Bee

Registered User.
Local time
Today, 19:02
Joined
Aug 1, 2006
Messages
486
Hi,

I am trying to make a combobox visible when the user clicks on one of a tab control buttons. I wrote this code below, but I does not seem to work. Both the tab control and the combo are on the same form.

Code:
Private Sub L_B_Consent_Click()
    Me.cmbLBConsent.Visible = True
End Sub

Any help will be very much appreciated.

Thanks,
B
 
what is the problem? it wont become visible? i think its a refernce problem.
lookhere
 
The Click event of a tab control is all but useless. Can you use anything else?
 
The Click event of a tab control is all but useless. Can you use anything else?
What do you mean? A button... or something like that? I would prefer to trigger the event automatically like on gotFocus, on click...etc on one of the tab buttons. I tried other events that are available, but none of them worked.

I also tried something I've seen in the list of references provided by rainman89, but still no luck.

Any suggestions,
B
 
That's good boblarson, it worked - thank you. So, to be able to specify a certain tab, I just need to use an if statement. right? Will give it a go.

Cheers,
B
 
That's good boblarson, it worked - thank you. So, to be able to specify a certain tab, I just need to use an if statement. right? Will give it a go.

Cheers,
B

Yep, an If will do it for you.

And, just an FYI -
Me.YourTabControl.Pages(n).SetFocus
or
Me.YourTabControl.Pages("PageNameHere").SetFocus

would set focus to another page (tab) on the tab control.
 
You do not get an OnChange event from the Tab Control if you are not changing pages.
 
You do not get an OnChange event from the Tab Control if you are not changing pages.
I don't need to do it on the first page, so the onChange will do.
 
RuralGuy said:
You do not get an OnChange event from the Tab Control if you are not changing pages.

Yes, but with the tab control you are very limited anyway so you don't want to have it executing anything unless you are changing pages. The click event and the mouse down, etc. don't actually do anything unless you click on the body of the tab control and not in the body of the pages. Even clicking on the TAB portion of the tab control will not generate a click event.
 

Users who are viewing this thread

Back
Top Bottom