Choise if Control Tip Text are shown in VBA form? PART II


Posted by Pasi Vartiainen on September 22, 2000 6:47 AM

:Posted by Ivan Moala on September 12, 19100 at 00:58:35:

:In Reply to: Choise if Control Tip Text are shown in VBA form? posted by Pasi Vartiainen on September 11, 19100 at 06:27:17:


:Yes you can
:Try something like this in your userform initialize event
:OR something similar.
:You could also put and option button on your userform
and intiate it this way.

:Private Sub UserForm_Initialize()
:Dim Obj As Object
:Dim TextOnOff As Integer

:TextOnOff = MsgBox("Turn text Off (Yes) or On (No)", vbYesNo)
:If TextOnOff = vbYes Then
:For Each Obj In Me.Controls
:Obj.ControlTipText = ""
:Next
:End If

:'The rest of your code

:End Sub


:HTH

:Ivan

Ivan posted ansver to my problem, and it's working perfectly... But now there is weird feature on control tip text:

Control tip text appear only objects which are checkbox type, control tip text of option buttons are not shown.

Do I have something wrong, or is this some undocumented excel 'feature'?

Pasi Vartiainen



Posted by Ivan Moala on September 22, 2000 4:48 PM

Pasi
Change your code to the one below.
The above code works on all objects or controls
in your userform....ie your command buttons too.
The code below will set you control tip text only

Private Sub UserForm_Initialize()
Dim Obj As Object
Dim TextOnOff As Integer

TextOnOff = MsgBox("Turn text Off (Yes) or On (No)", vbYesNo)
If TextOnOff = vbYes Then
For Each Obj In Me.Controls
If InStr(1, Obj.Name, "Check", 1) <> 0 Then
Obj.ControlTipText = ""
End If

Next
End If

End Sub

Ivan