i have to know what button of mouse clicked...

  • Thread starter Thread starter DotNetMania
  • Start date Start date
D

DotNetMania

panel has not Key press event... that's why..


if i have to figure invoking any event out when panel clicked

it is so difficult...what button is clicked ....

button of Mouse like .. Left, Middle, and Right...

how can i distiguish...


i have to use Click event because panel has not key events...

private void panScreen_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouse = (MouseEventArgs)sender; // Error...
if (mouse.Button == MouseButtons.Left)
{

}
 
DotNetMania said:
panel has not Key press event... that's why..


if i have to figure invoking any event out when panel clicked

it is so difficult...what button is clicked ....

button of Mouse like .. Left, Middle, and Right...

how can i distiguish...


i have to use Click event because panel has not key events...

private void panScreen_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouse = (MouseEventArgs)sender; // Error...
if (mouse.Button == MouseButtons.Left)
{

}

From the docs to Control.Click:

<quote>
The Click event passes an EventArgs object to its event handler, so it
only indicates that a click has occurred. If you need more specific
mouse information (button, number of clicks, wheel rotation, or
location), use the MouseDown and MouseUp events which pass a
MouseEventArgs object to the event handler.
</quote>
 
Back
Top