[Mono-bugs] [Bug 330501] New: ComboBox: OnValidating method not called on form close

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 3 13:57:00 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=330501

           Summary: ComboBox: OnValidating method not called on form close
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: x86
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at ximian.com
          Found By: ---


Steps to reproduce issue:

1. Run code
2. Close window by pressing cross in upper right window

Observed:

Window is closed

Expected:

Window should not closed. Lookup form should appear.


using System;
using System.Windows.Forms;

        public class Form1 : Form {
MyComboBox MyCombobox = new MyComboBox();

                [STAThread]
                public static void Main() {
                        try {
                                Application.Run(new Form1());
                        }
                        catch (Exception e) {
                                MessageBox.Show(e.ToString());
                        }
                }

                public Form1() {
                        this.Controls.Add(MyCombobox);
                TextBox         tb = new TextBox();
                        tb.Top = 200;
                        Controls.Add(tb);
                }

        }


public class MyComboBox : ComboBox {

        protected override void
OnValidating(System.ComponentModel.CancelEventArgs e) {
                e.Cancel = true;
                Form f = new Form();
                f.Text = "Modeless lookup form";
                f.Show();
        }
}


-- 
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