Thursday, August 27, 2009

Windows Programming - Working with MouseMove

using System;
using System.Windows.Forms;
using System.Drawing;
class myfrm : Form
{
public myfrm()
{
this.MouseMove +=new MouseEventHandler(fun);
}
void fun(object o, MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
g.DrawEllipse(Pens.Red, e.X - 50, e.Y - 50, 100, 100);
}
}
class Program
{
static void Main(string[] args)
{
myfrm f = new myfrm();
f.ShowDialog();
}
}

No comments:

Post a Comment