Re: Tooltips and MouseMove event
Peter Osucha <[email protected]> Thu, 12 Jul 2007 09:08:23 -0400
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
Andrew,=20 The same problem shows in XP. The workaround did always involve looking for a change for the text being used for the tooltip (same vein as you suggested). Peter -----Original Message----- From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:[email protected]] On Behalf Of Eames, Andrew Sent: Thursday, July 12, 2007 8:56 AM To: [email protected] Subject: Re: [DOTNET-CX] Tooltips and MouseMove event Sounds like a problem I ran into. Are you running under Vista by any chance? I found that under Vista, setting the tooltip generates a spurious mouse move event so setting the tooltip in a mouse move event handler causes looping. Workaround is to only set the tooltip if it is different from the current tooltip Andrew -----Original Message----- From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:[email protected]] On Behalf Of Peter Osucha Sent: Thursday, July 12, 2007 6:58 AM To: [email protected] Subject: [Spam:********** SpamScore] Re: [DOTNET-CX] Tooltips and MouseMove event Hi Fabian, Thanks for the response. This does seem to be very odd behavior. FWIW, you can duplicate the issue I was having with the code that follows my email. I did get this issue solved, however. If you want, I can go into details about what I did. Peter ----------------------- Code to show this strange (to me) behavior // Put a panel control on a form and copy and paste this into the code section for the form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace ToolTipandMouseMove { public partial class Form1 : Form { ToolTip _tt; public Form1 ( ) { InitializeComponent ( ); _tt =3D new ToolTip ( ); _tt.AutoPopDelay =3D 3000; _tt.InitialDelay =3D 100; _tt.SetToolTip(panel1, "This is my tooltip"); } private void panel1_MouseMove ( object sender, MouseEventArgs e ) { _tt.SetToolTip ( panel1, "ToolTipTicks..." + DateTime.Now.Ticks.ToString() ); } } } -----Original Message----- From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:[email protected]] On Behalf Of Fabian Schmied Sent: Thursday, July 12, 2007 3:05 AM To: [email protected] Subject: Re: [DOTNET-CX] Tooltips and MouseMove event Hi Peter, > Anyway, I have realized that it would be very beneficial to provide > tooltips when the mouse hovers over some of the shapes I have drawn. To > try to implement this, I have created a ToolTip object in the Cartridge > class and have attempted to set it in two places - first, an event > handler connected to the _canvas.MouseMove() event; second, in an event > handler connected to the _canvas.MouseHover() event. Neither produces > the desired effect. Have you already solved this problem? If no, it might be useful if you could post some code of what you're doing; ideally a small, complete sample. > The MouseMove() event seems to fire at intervals of about 500 ms > regardless of whether or not I am moving the Mouse over the _canvas. > The MouseHover() event never (very, very seldom) seems to fire. This seems very strange, how do you determine how often these events fire? Are you tracing something to the debug output or are you just basing this on the fact that your tooltip doesn't appear? If the latter, it's probably a tooltip problem rather than a mouse event problem. Fabian =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This list is hosted by DevelopMentor=AE http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com