Dentro de una clase :
int x,y;
// Constructor
public Form1()
{
InitializeComponent();
//Agregar metodo
this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
}
//Metodo picturebox mousemove
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
x = e.Location.X;
y = e.Location.Y;
}
// se obtiene la posicion en x e y.
No hay comentarios:
Publicar un comentario