[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# mouse event

Posted on 2005-04-25
8
Medium Priority
?
395 Views
Last Modified: 2010-04-16
hii,
 how do i do a mouse stop event, when the mouse stop a tooltip display the (x,y) point at the form
0
Comment
Question by:madmare
8 Comments
 
LVL 8

Expert Comment

by:vinhnl
ID: 13858886
?? i don't understand :(
0
 

Author Comment

by:madmare
ID: 13858975
i want to make mouseup event
0
 
LVL 8

Expert Comment

by:vinhnl
ID: 13859122
can you explain more?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:madmare
ID: 13859187
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
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 13859498
Use the "MouseHover" event.
0
 
LVL 8

Accepted Solution

by:
vinhnl earned 2000 total points
ID: 13859921
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
 

Author Comment

by:madmare
ID: 13861585
how do i use "MouseHover" ???
0
 
LVL 21

Expert Comment

by:Yurich
ID: 13862746
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question