JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Creating Tool Tips

Tool tips are components, not controls, so when you add them to a Windows forms project, they'll appear in a component tray beneath the form you're adding them to. You can associate them with controls with the SetToolTip method if you pass that method the control you want to associate the tool tip with (and remember that this works for forms, which are derived from the Control class, as well). Here's how that looks in the ToolTips example on the CD-ROM:

Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
    ToolTip1.SetToolTip(Me, "This is a form.")
    ToolTip2.SetToolTip(Button1, "This is a button")
End Sub

You can see the result in Figure 8.6, where the tool tip attached to the button is displayed.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor