The ToolTip Control in VB.Net
The
ToolTip control is used to display some text when the mouse is move over a control. This control is helpful in providing quick information when the user moves the pointer over an associated control.
How to use ToolTip control
Drag and drop a Tooltip control and control on which you want to use tooltip control
Code:
Public Class Form18
Private Sub Button1_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
'show tooltip on button
ToolTip1.SetToolTip(Button1, "Click to show time")
' SetToolTip method assign a ToolTip with control
End Sub
End Class
Run the project
When mouse move over the Time button then MouseHover event will fire and tooltip text will show.
ToolTip properties
Active - set the tooltip status, by default it set to true set false to hide the tooltip.
ToolTipIcon -set the icon that will show on the tooltip.
Private Sub Form18_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'set the tooltip icon
ToolTip1.ToolTipIcon = ToolTipIcon.Info
End Sub
IsBalloon: when IsBalloon property is true then tooltip will display as a balloon.
Private Sub Form18_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'tooltip show as baloon
ToolTip1.IsBalloon = True
End Sub
Leave Comment