Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=77690 --- shadow/77690 2006-03-02 08:38:17.000000000 -0500 +++ shadow/77690.tmp.28273 2006-03-02 08:38:17.000000000 -0500 @@ -0,0 +1,53 @@ +Bug#: 77690 +Product: Mono: Class Libraries +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Control.OnClick do not supply a MouseEventArgs + +Description of Problem: + +The method +protected virtual void OnClick (EventArgs e); +doesn't provide a MouseEventArgs when overridden. This makes it impossible +to use it to get the mouse clicks. + +Steps to reproduce the problem: +1. Compile this snippet inside a winform application + +protected override void OnClick (EventArgs e) +{ + MouseEventArgs mea = (e as MouseEventArgs); + if (mea == null) + Console.WriteLine ("Expected MouseEventArgs but got " + e.ToString ()); +} + +2. Click on the form + + +Actual Results: +EventArg is empty (not null) and cannot be cast to a MouseEventArgs (like +on MS Fx). So the console shows +Expected MouseEventArgs but got EventArgs + +Expected Results: +I should be able to cast the EventArgs into a MouseEventArgs and get the +click position (i.e. no message on console). + +How often does this happen? +Always + +Additional Information: +* Only tested under fx 2.0 and Mono SVN. +* Changed my code to overriding OnMouseDown (which use MouseEventArgs) _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
