ControlTipText Property

Applies To

CheckBox control, ComboBox control, CommandButton control, Image control, Label control, ListBox control, MultiPage control, OptionButton control, Page object, ScrollBar control, SpinButton control, Tab object, TabStrip control, TextBox control, ToggleButton control.

Description

Specifies text that appears when the user briefly holds the mouse pointer over a control without clicking.

Syntax

object.ControlTipText [= String]

The ControlTipText property syntax has these parts:

Part

Description

object

Required. A valid object.

String

Optional. The text that appears when the user holds the mouse pointer over a control.


Remarks

The ControlTipText property lets you give users tips about a control in a running form. The property can be set during design time but only appears by the control during run time.

The default value of ControlTipText is an empty string. When the value of ControlTipText is set to an empty string, no tip is available for that control.

Example

The following example defines the ControlTipText property for three CommandButton controls and two Page objects in a MultiPage.

To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A MultiPage named MultiPage1.
  • Three CommandButton controls named CommandButton1 through CommandButton3.
Note For an individual Page of a MultiPage, ControlTipText becomes enabled when the MultiPage or a control on the current page of the MultiPage has the focus.

Private Sub UserForm_Initialize()
    MultiPage1.Page1.ControlTipText = "Here in page 1"
    MultiPage1.Page2.ControlTipText = "Now in page 2"
    
    CommandButton1.ControlTipText = "And now here's"
    CommandButton2.ControlTipText = "a tip from"
    CommandButton3.ControlTipText = "your controls!"
End Sub