I have a problem with probably a simple solution, but I just dont get it right.
So I want something to happen if I press the left mouse button.
private void DrawingPanel_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
//something happens
}
}
So, that works fine. but now the problem comes inn. Now I want to check for more clicks within the click event (now that I think about it, is that even possible?)
Something like this:
private void DrawingPanel_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
//something happens
//blabla...
if (e.Button == MouseButtons.Left)
{
//Do something
}
}
}
Is something like that possible? Because the second if (e.Button == MouseButtons.Left) is always true.
How can I do it so that its not automaticlly true?
This won’t work out the way you implemented it, because within that handler you still handle the one mouse-click event.
Try handling the Control.DoubleClick-event instead.