
SStab control tab click , activating tab
If you drop an SSTab on a form, drop Text1 and Text2 on Tab 0 and any number
of controls on any other tab, paste the following code... and.... make sure
the tab controls CausesValidation property = True, you'll see that the tab
doesn't even attempt to change if Cancel = True (below)
'==========
Option Explicit
Private Sub Text1_Validate(Cancel As Boolean)
If Text1.Text <> "Text1" Then
Cancel = True
End If
End Sub
Private Sub Text2_Validate(Cancel As Boolean)
If Text2.Text <> "Text2" Then
Cancel = True
End If
End Sub
'==========
--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
http://www.vbsight.com/TBGDialogCTL.htm
Quote:
> Hi all,
> I am using SStab control from the Microsfot tabbed controls. In
> my tab i have 3 tabs. I have some controls in first tab. When I click
> tab 3 , some validation has to happen with controls in the first
> tab. That is happening when i click 3rd tab. But before the
> validation is over with success , the 3rd tab content should not be
> visible. If the validation fails the active tab should not happen for
> the clicked tab. But what happening is when i click 3rd tab, the 3rd
> tabs become active tab, then the click event of tab is happening
> which is containing the validation code.
> Is it possible to change this behaviour.
> Thanks in advance for any help.....
> -Regards
> Santhakumar B