Generated when a Tab object in a TabStrip control is clicked, or a Tab object's Selected setting has changed.
Syntax
Private Sub object_BeforeClick(cancel As Integer)
The BeforeClick event syntax has these parts:
Part | Description |
object | An object expression that evaluates to a TabStrip control. |
cancel | Evaluates to an integer with values of 0 (False) and -1 (True). The initial value is 0. |
Remarks
Use the BeforeClick event to validate the information on the old Tab object before actually generating a Click event that selects the new Tab object. Setting the cancel argument to True allows you to stop a change to the new selection.
Note Setting the cancel argument to True prevents the focus from switching to another tab but doesn't stop the Click event from occurring.
Note If you use the MsgBox or InputBox functions during the BeforeClick event procedure, the TabStrip control will not receive a Click event, regardless of the setting of the cancel argument.