Skip to content

Watching mouse cursor

holestary

Asked Apr 17, 2009, 5:52 AM EDT3 answers
Share
LinkedInX
    hi,

    i have to make an application in C#..that is form and there is an eye on it..while i moving the mouse cursor eye will watch it..but eye will not move with mouse cursor..it is only watching it simultaneously ...

    how can i do that.. i try it again and again but i couldn't do.. i asked that my friends..they say i should use mousemove event...and timer...but i couldn't..
 
   please help...

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    Here are some articles on mouse and keyboard events handling.

    Mouse and Key Events by Sankar Ramanathan on Jan 18, 2006
    This article explains the usage of key and mouse events. The following code shows you how you can read mouse position on mouse move.


    Area sensitive help by Gaurav Tomar on Aug 28, 2008
    This article tells you how to create a help window which appears when your mouse moves on a particular web page area.


    Handling Mouse Events in C# by Mahesh Chand on Apr 05, 2009
    This article explains how to handle mouse events in C# or VB. In C#, you write a delegate and then write an event handler.


    Custom Mouse-Joystick in C# by Lance Drolet on Aug 29, 2006
    It is a custom control that allows you to use your mouse as a joystick.





    Event Handling in C# by Anand Narayanswamy on Jan 17, 2006
    This article shows you how to write control, mouse, and keyboard event handlers in C#.
    0
  • 0
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace son
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
    {

    int x = e.X;

    int y = e.Y;

    groupBox1.Location = new Point(x, y);

    }
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
    }
    }

    there is a picturebox on the groupbox..and while i moving the mouse it move with it...but i want it only watch mouse...
    0
  • 0
    i find javascript and i want do this in C#          Link
    0