|
-
Oct 9th, 2009, 08:31 AM
#1
Thread Starter
Lively Member
"Hover text" on a control
In HTML you can add an ALT property to an IMG tag so when a user hovers over a picture, a little box appears with a description.
How can I add this feature to a button or other control within my form?
I assume that I would edit the method "MouseEnter" (I am guessing that means when the mouse "enters" the area of the button)?
But I wouldn't even know where to start as far as coding the little box that would appear with a description.
I didn't find anything within the Properties box (like where you can specify the TEXT to appear on a control)
Or perhaps I overlooked it (or its called something that doesn't make it obvious)
Thanks for your help
-
Oct 9th, 2009, 08:35 AM
#2
Re: "Hover text" on a control
You mean ToolTips? Add a ToolTip control to the form, then set the ToolTip Text property on each control, if there is no text set then nothing will be shown when the mouse is hovered over the control.
-
Oct 9th, 2009, 08:41 AM
#3
Thread Starter
Lively Member
Re: "Hover text" on a control
 Originally Posted by JuggaloBrotha
You mean ToolTips? Add a ToolTip control to the form, then set the ToolTip Text property on each control, if there is no text set then nothing will be shown when the mouse is hovered over the control.
So within Button1.MouseHover()
ToolTip1.what?
I dont see a .text or anything related.
Do I call the tooltop's .popup and give it a string as a parameter or something like that?
-
Oct 9th, 2009, 08:45 AM
#4
Re: "Hover text" on a control
You don't use any events and you don't call the tooltip to have it display, it does that automatically.
Add a ToolTip control to your form (drag it from the toolbox and drop it on your form) now select one of the buttons and look for the "ToolTip on ToolTip1" property in the properties window. Type in some text then run your program, hover the mouse of that button and the tooltip automatically shows after 3 seconds (you can change the delay time on the ToolTip control too)
-
Oct 9th, 2009, 08:54 AM
#5
Re: "Hover text" on a control
Just one small thing that I always like to point out for the sake of being precise: the ToolTip is not a control; it's a component. If a class doesn't inherit the Control class then it's not a control. Any class that implements IComponent can be designed.
-
Oct 9th, 2009, 08:58 AM
#6
Thread Starter
Lively Member
Re: "Hover text" on a control
Okay I got it to work. THanks for the help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|