[Mono-bugs] [Bug 439879] New: Loading a form that contains a user control fails

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 29 10:49:36 EDT 2008


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


           Summary: Loading a form that contains a user control fails
           Product: Mono: Runtime
           Version: 1.9
          Platform: Other
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ole at monochrom.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


When I load a form that contains a user control, which has the .Load event
Handler set to an member function of the parent form

this.mycontrol.load = new System.EventHandler(this.loadHandler);

, this happens: 

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Alias.Forms.GlobalSettings.GlobalSettings_Load (System.Object sender,
System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Form.OnCreateControl () [0x00000] 
  at System.Windows.Forms.Control.CreateControl () [0x00000] 
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&
m) [0x00000] 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.ScrollableControl.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.ContainerControl.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000] 
  at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message,
IntPtr wParam, IntPtr lParam) [0x00000] 
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd hwnd,
WindowType windows) [0x00000] 
  at System.Windows.Forms.XplatUIX11.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00000] 
  at System.Windows.Forms.XplatUI.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00000] 
  at System.Windows.Forms.NativeWindow.CreateHandle
(System.Windows.Forms.CreateParams create_params) [0x00000] 
  at System.Windows.Forms.Control.CreateHandle () [0x00000] 
  at System.Windows.Forms.Form.CreateHandle () [0x00000] 
  at System.Windows.Forms.Control.CreateControl () [0x00000] 
  at System.Windows.Forms.Control.SetVisibleCore (Boolean value) [0x00000] 
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] 
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:set_Visible (bool)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Form.ShowDialog (IWin32Window ownerWin32) [0x00000] 
  at System.Windows.Forms.Form.ShowDialog () [0x00000] 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:ShowDialog
()
  at Alias.Forms.AliasController.AliasController.button_Config_Click
(System.Object sender, System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.ButtonBase.OnMouseUp
(System.Windows.Forms.MouseEventArgs mevent) [0x00000] 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs
mevent) [0x00000] 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m)
[0x00000] 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000] 
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] 
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
[0x00000] 
  at Alias.Program.Main (System.String[] args) [0x00000] 

The code works well with windows .NET 2.0.


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