P
Poornima
Hello,
I have a mouse click event in which i need to draw a line if the mouse
was clicked within specified co-ordinates.I wrote the following code
private void Form1_MouseClick(object sender, MouseEventArgs
e,PaintEventArgs pe)
{
Graphics mclkDl = pe.Graphics;
Pen dashPen = new Pen(Color.Gray, 1);
tbMouseX.Text = "The X-cordinate is " + MousePosition.X;
tbMouseY.Text = "The Y-cordinate is " + MousePosition.Y;
nMouseX = MousePosition.X;
nMouseY = MousePosition.Y;
if(nMouseX >= 50 && nMouseY == 169)
mclkDl.DrawLine(dashPen, 50, 80, 169, 80);
}
but it gave an error saying
"No Overload for form1_MouseClick matches delegate
'System.Windows.Forms.MouseEventHandler'"
Can any one of you please tell me whts wrong in the code
Thanks In Advance
Poornima
I have a mouse click event in which i need to draw a line if the mouse
was clicked within specified co-ordinates.I wrote the following code
private void Form1_MouseClick(object sender, MouseEventArgs
e,PaintEventArgs pe)
{
Graphics mclkDl = pe.Graphics;
Pen dashPen = new Pen(Color.Gray, 1);
tbMouseX.Text = "The X-cordinate is " + MousePosition.X;
tbMouseY.Text = "The Y-cordinate is " + MousePosition.Y;
nMouseX = MousePosition.X;
nMouseY = MousePosition.Y;
if(nMouseX >= 50 && nMouseY == 169)
mclkDl.DrawLine(dashPen, 50, 80, 169, 80);
}
but it gave an error saying
"No Overload for form1_MouseClick matches delegate
'System.Windows.Forms.MouseEventHandler'"
Can any one of you please tell me whts wrong in the code
Thanks In Advance
Poornima