[Mono-bugs] [Bug 334244] New: Form. CheckAcceptButton throws nullref with non-standard button

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 16 08:10:00 EDT 2007


           Summary: Form.CheckAcceptButton throws nullref with non-standard
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: i686
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: dsuarezv at codice.es
         QAContact: mono-bugs at ximian.com
          Found By: ---

Using a set of non-standard button classes I have found an issue in the
Form.AcceptButton method. Problem is with this piece of code: 

internal override void CheckAcceptButton()
    if (accept_button != null) {
        Button a_button = accept_button as Button;

        if (ActiveControl == a_button)

        if (ActiveControl is Button) {
            a_button.paint_as_acceptbutton = false;
        } else {
            a_button.paint_as_acceptbutton = true;

While accept_button is defined in MSDN as IButtonControl, here it is casted to
Button. The result is that a form with an non-standard Button in the 
acceptbutton property throws a nullref.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list