|
-
Mar 29th, 2016, 04:06 PM
#2
Re: Dynamically adding tool-tips to controls
Okay, so what's the issue? That's not the correct signature for a method that handles a MouseHover event, since it takes the wrong arguments, but maybe you left the signature out of the post.
I took a look at some code I had that dealt with it, and notice that I was setting the tooltip in MouseMove, but only if the current text associated with the control has changed. That was because the tooltips I was displaying depended on what part of a control the mouse was over.
Ah, I noticed one key mistake: You don't create a ToolTip like that. Add one to the form at design time by dragging it from the Toolbox. It doesn't matter whether you set text for it at design time, and if you have no text associated with a control, it won't show at all. So, you want the tooltip already there. What you are doing dynamically, is changing whether or not it is shown and what is shown. If you have no text, it won't show, if you set text, then it will.
My usual boring signature: Nothing
 
Tags for this Thread
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
|