[Mono-bugs] [Bug 545355] New: Load event isn't called

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 8 10:24:06 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=545355


           Summary: Load event isn't called
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Christoph at ApiViewer.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:
Load event isn't called for all subitems

Steps to reproduce the problem:

    class MainWindow : System.Windows.Forms.Form {    
        static MainWindow    main_window;

        public MainWindow() {
            TabControl t = new TabControl();

            TabPage Tab = new TabPage("Test1"); 
            Tab.Controls.Add(new MyControl());  
            t.TabPages.Add(Tab);

            TabPage Tab2 = new TabPage("Test2"); 
            Tab2.Controls.Add(new MyControl()); 
            t.TabPages.Add(Tab2);

            Controls.Add (t); 
             ResumeLayout();
        }    

        public static int Main(string[] args) {
            main_window = new MainWindow();
            Application.Run(main_window);
            return 0;
        }
    }


    class MyControl : System.Windows.Forms.UserControl
    {
        public MyControl()
        {
            this.Load += new System.EventHandler(this.MyControl_Load);
        }

        private void MyControl_Load(object sender, EventArgs e)
        {

            Console.WriteLine("Test"); 
        }
    }




Actual Results:
MyControl_Load is only called for the control on the first TabPage

Expected Results:
MyControl_Load should be called for all controls on the added TabPages

How often does this happen? 
Always

Additional Information:

-- 
Configure bugmail: http://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