Windows Develop Bookmark and Share   
 index > Windows Forms General > tooltip shows wrong message
 

tooltip shows wrong message

I have the following code in a program I just wrote.

Control c = this.contextMenuStrip1.SourceControl;

if (myTag >= 63 && myTag <= 65 && !Option)

{

this.toolTip1.Show(tipMessages[myTag + 7],

c, new Point(c.Size));

}

else

{

this.toolTip1.Show(tipMessages[myTag],

c, new Point(c.Size));

}

If I leave the code as is, I get the wrong messageif I do "what's this" right after Option changes. If I duplicate each of the shows this does not happen. Anyone have any idea of what could be going on?

Thanks, Neal

Neal Ray Pov  Tuesday, July 22, 2008 10:48 PM
That rings a bell. I worked on a thread a while ago where resetting the text, then setting it again was required to get the proper tip. I can't find it back. Your workaround is appropriate.
nobugz  Wednesday, July 23, 2008 1:17 AM
It's impossible to tell without seeing the scope of myTag, Option or where this code is located. Try using the debugger.
nobugz  Wednesday, July 23, 2008 12:10 AM
I have already verified that in all cases the correct part of the if statement is being executed. All I have to do to get rid of the problem (or to cover it up) is to repeat each show statement. That is, place two identical show statements in each part of the if statement. Neal

Neal Ray Pov  Wednesday, July 23, 2008 1:06 AM
That rings a bell. I worked on a thread a while ago where resetting the text, then setting it again was required to get the proper tip. I can't find it back. Your workaround is appropriate.
nobugz  Wednesday, July 23, 2008 1:17 AM

You can use google to search for other answers

Custom Search

More Threads

• My panel quit resizing when the panel inside is is not visible!
• C# PropertyGrid value changed - catch event
• How to Start
• Forms Painting problem
• How to show a WinForm without stealing focus?
• Positioning relative to new form.
• override copy command
• changing command button based on sql query
• Forms from 6.0 to .Net
• watching the port of printer