hover text on command buttons...

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

Using vb.net 2005. Is there an easy way to allow text to be displayed when
the user hovers on a command button - similiar to what you get when using a
toobar menu strip?

Thanks Brad
 
Using vb.net 2005. Is there an easy way to allow text to be displayed when
the user hovers on a command button - similiar to what you get when using a
toobar menu strip?

Thanks Brad

You mean a tooltip?

Thanks,

Seth Rowe
 
Just Drag a Tooltip from the toolbox on you windows form and write the
following code in code behind file.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.MouseHover
ToolTip1.SetToolTip(Button1, "sometext")
End Sub
 
put this in form load:

' Create the ToolTip and associate with the Form container.
Dim toolTip1 As New ToolTip

' Set up the delays for the ToolTip.
toolTip1.AutoPopDelay = 5000
toolTip1.InitialDelay = 1000
toolTip1.ReshowDelay = 500
' Force the ToolTip text to be displayed whether or not the form is
active.
toolTip1.ShowAlways = True
'main form
toolTip1.SetToolTip(ButtonName, "Text to put in Tool Tip Help")
 
Normally, if you take a Tooltip object from the toolbox and you create
one on your form (in the object bar, in the lowest part of the screen)
all your controls on that form should have a new property in the
"Misc" section, which is the text to be displayed by the tooltip.

To configure the tooltips display time etc, just modify the Tooltip
object's properties...

This exists in VS2003... I can only guess that MS didn't delete the
concept in VS2005, also, what Tracks and Shawn.Bower said works, but
since the whole tooltip thing is usable without coding, why not save
the time ?

Hope it helps
 
Perfect. It works like a top. I didn;t even notice the tooltip control in
the toolbox!!!

Thanks, Brad
 
Back
Top