Control.OnClick

  • Thread starter Thread starter benben
  • Start date Start date
B

benben

I have a form that overrides the OnClick method. The caller sends in an
EventArgs parameter but how can I extract the mouse coordinates from the
EventArgs???? I tried explicit convertion to MouseEventArgs but an
InvalidCastException is thrown.

I know the original OnClick method raises the Click event so it must be able
to somehow extract more information from the EventArg. Does anyone know how
it is achieved?

ben
 
Try using the event OnMouseUp to get the click location. OnClick can be
called when the user uses the KeyBoard and hence it's not always associated
with a mouse click co-ordinates
 
Thanks! That's exactly what I needed to know!

Try using the event OnMouseUp to get the click location. OnClick can be
called when the user uses the KeyBoard and hence it's not always associated
with a mouse click co-ordinates
 
Back
Top