Tab Change

Started by Marc van Cauwenberghe, March 21, 2010, 08:05:37 AM

Previous topic - Next topic

Marc van Cauwenberghe

Hello,

Is there any way to detect the a user has changed Tab in a Tabcontrol?

Regards,
Marc

Rolf Brandt

Hi Marc,

you might try this:
Function FORM1_WM_NOTIFY ( _
                         hWndForm     As Dword,     _  ' handle of Form
                         idCtrl       As Dword,     _  ' control ID
                         ByVal pNMHDR As NMHDR Ptr  _  ' pointer to NMHDR structure
                         ) As Long

   Select Case idCtrl
      Case IDC_FORM1_TABCONTROL1
         Select Case @pNMHDR.Code
            Case %TCN_SELCHANGE
               MsgBox "Bingo2
         End Select
   End Select
End Function


It will though fire also when the form loads.
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Marc van Cauwenberghe

Hey Rolf,

Thank you, will try it.

Regards,
Marc

Rolf Brandt

With
FF_TabControl_GetSelectedTab
you can check which Tab is selected.
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)