Visual Basic - Provide Instant Help To Users With ToolTips (Visual Basic .NET)

Visual Basic 6 developers are probably very familiar with ToolTips, since almost every control has a ToolTipText property built in. However, to provide ToolTips in Visual Basic .NET, you need to use the ToolTip control. Once you've added the ToolTip control to a form, click on any other control on the form and locate its ToolTip property in the Properties list (the actual property name includes the word "on" and the control name). Then, enter a tip string. One of the advantages Visual Basic .NET's ToolTips have over those in Visual Basic 6 is the ability to produce multi-line tip strings. To create a multi-line ToolTip, use the SetToolTip() method of the ToolTip control, like so:

  • ToolTip1.SetToolTip(TextBox2, _ "Enter the phone" & vbCrLf & _ "number in the format:" & vbCrLf & _ "(555)555-5555")

Go back