You can use this to get the local coords
Point localMousePosition = panel1.PointToClient(Cursor.Position);
mick
Point localMousePosition = panel1.PointToClient(Cursor.Position);
Also, when you create your Graphics object are you using something
like this
Graphics g = panel1.CreateGraphics();
mick
It sounds like you are handling the forms paint event handler rather
than the panels paint handler. You want to handle the panel's paint
event as follows:
public Form1()
{
InitializeComponent();
panel1.Paint += new PaintEventHandler(panel1_Paint);
}
void panel1_Paint(object sender, PaintEventArgs e)
{
Pen p = Pens.Black;
Point loc = new Point (0, 0);
Size s = new Size(12, 15);
Rectangle r = new Rectangle(loc, s);
e.Graphics.DrawEllipse(p, r);
}
--
Mike