Tab Control problem

I

Ilya

I want to use Event Procedure when pressing specific page tab on the form.
Page exposes events: click, dblclick, etc. I put MsgBox “OK†into click event
procedure code, but that event is not fired when clicking on page tab, why?
Tab control event procedure works: it fires when click on tab Control. But
tab control is not activated automatically when pressing on specific page
tab.
So, how to activate event procedure when clicking on page tab?
Thanks in advance for help
 
I

Ilya

That is the problem:how to fire Tab Control Event? The user switches the page
of the form by pressing page tab, not tab control. How to activate tab
control each time page is activated.
 
R

Rick Brandt

Ilya said:
That is the problem:how to fire Tab Control Event? The user switches
the page of the form by pressing page tab, not tab control. How to
activate tab control each time page is activated.

When they change pages the Change event of the control fires.
 
J

John Vinson

There appears to be a native On Click event for each tab, does this not work?

The Click event is pretty useless: it responds to a mouseclick *on the
face of the tab page*.

The event to detect the user selecting a tab is the Tab Control's
Change event.

John W. Vinson[MVP]
 
G

glenn52

T
Thanks John

and would we use the control change event like;

If Me.ctrlTabControl.Pages.Count = 1 Then
DoSomething (when 2nd tab is clicked)
End If

??


glenn52
 
J

John Vinson

T
Thanks John

and would we use the control change event like;

If Me.ctrlTabControl.Pages.Count = 1 Then
DoSomething (when 2nd tab is clicked)
End If

Well... not especially.

Private Sub ctrlTabControl_Change()
Select Case ctrlTabControl.Value ' which page was selected
Case 0 ' first page, it's the zero-based Index property of the tab
<do something>
Case 1 ' second page
<do something else>
...
End Select


John W. Vinson[MVP]
 
A

Atlas

John Vinson said:
Well... not especially.

Private Sub ctrlTabControl_Change()
Select Case ctrlTabControl.Value ' which page was selected
Case 0 ' first page, it's the zero-based Index property of the tab
<do something>
Case 1 ' second page
<do something else>
...
End Select


John W. Vinson[MVP]
hi
The above has been very helpful to me - so thanks , however, is it
possible to change the fontweight of the page caption to bold etc -
Everytime I try to do this I get error message

Thank you

Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top