[Mono-osx] Null Reference Exception in Painting of ScrollBar of Multiline Text Box

Bimal.Delhi bimal_gkp at hotmail.com
Wed Sep 30 03:12:47 EDT 2009

	I've an application which has a Multiline text box with word wrap enabled.
I'm adding lines to the text box at run time. when ever the text goes beyond
the visible capacity of the text box a scroll bar appears. the problem is
that this scroll bar gets redrawn every time something is added and then the
application crashes by giving the following exception.

System.NullReferenceException: Object reference not set to an instance of an
  at System.Windows.Forms.Control.PaintControlBackground
(System.Windows.Forms.PaintEventArgs pevent) [0x00000] 
  at System.Windows.Forms.Control.OnPaintBackground
(System.Windows.Forms.PaintEventArgs pevent) [0x00000] 
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m)
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
  at System.Windows.Forms.ScrollBar.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] 

Apart from this i periodically get the following message. i don't from where
it is coming

mono[376] : CGContextDrawImage: invalid context

View this message in context: http://www.nabble.com/Null-Reference-Exception-in-Painting-of-ScrollBar-of-Multiline-Text-Box-tp25676081p25676081.html
Sent from the Mono - OSX mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20090930/6381bedc/attachment.html 

More information about the Mono-osx mailing list