• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

C# mouse event

hii,
 how do i do a mouse stop event, when the mouse stop a tooltip display the (x,y) point at the form
0
madmare
Asked:
madmare
1 Solution
 
vinhnlCommented:
?? i don't understand :(
0
 
madmareAuthor Commented:
i want to make mouseup event
0
 
vinhnlCommented:
can you explain more?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
madmareAuthor Commented:
the problem that i solve is: when the mouse pointer stop in any point om the Form, a toolTip display the coardination (x,y) for this point on the Form
0
 
Carl TawnSystems and Integration DeveloperCommented:
Use the "MouseHover" event.
0
 
vinhnlCommented:
See this code:


            private System.Windows.Forms.Timer timer1;
            private System.Windows.Forms.ToolTip toolTip1;
            private void Form1_Load(object sender, System.EventArgs e)
            {
                  toolTip1 = new ToolTip();
                  toolTip1.AutoPopDelay = 5000;
                  toolTip1.InitialDelay = 1000;
                  toolTip1.ReshowDelay = 500;
                  toolTip1.ShowAlways = true;
                  toolTip1.SetToolTip(this,Cursor.Position.X.ToString()+","+Cursor.Position.Y.ToString());
                  timer1 = new System.Windows.Forms.Timer();
                  timer1.Enabled = true;
                  timer1.Interval = 1000;
                  timer1.Tick += new System.EventHandler(this.timer1_Tick);
            }

            private void timer1_Tick(object sender, System.EventArgs e)
            {
                  if(Cursor.Position.X >= Left && Cursor.Position.X <= Left + Width
                        && Cursor.Position.Y >= Top && Cursor.Position.Y <= Top + Height)
                  toolTip1.SetToolTip(this,((int)(Cursor.Position.X-Left)).ToString()+","+((int)(Cursor.Position.Y-Top)).ToString());
            }

Good luck
VINHNL
0
 
madmareAuthor Commented:
how do i use "MouseHover" ???
0
 
YurichCommented:
you don't have to use MouseHover, you can use proper tool tips:

well, first you'll have to drag&drop tool tip control from your tool-box on your form

then you should set set this tool tip for all controls on your form (form probably including) that you'd like to have tool tips:

select a control (button, texbox, form itself), then press F4 (properties) find "ToolTip on tooltip1" field and type in your tool tip.

done :)

you can select later your tooltip properties, like delay time and etc.
basically the same as vinh listed, but not programatically


regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now