B
Brett O'Callaghan
I have an application, one evening it was working fine, the next
morning it's dead. I don't know what has changed in that time.
It appears to be dying on the line of code setting the font of a
listview control, ie
Me.lvStatus.Font = New System.Drawing.Font("Microsoft Sans Serif",
9.0!, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
This is the error, any suggestions at all appreciated!
Object reference not set to an instance of an object
at
System.Drawing.SafeNativeMethods.GdipCreateFontFromLogfontW(HandleRef
hdc, Object lf, IntPtr& font)
at System.Drawing.Font.FromLogFont(Object lf, IntPtr hdc)
at System.Drawing.Font.FromHfont(IntPtr hfont)
at System.Windows.Forms.Control.get_DefaultFont()
at System.Windows.Forms.Control.get_Font()
at System.Windows.Forms.ListView..ctor()
at CS.frmMain.InitializeComponent()
at CS.frmMain..ctor()
at CS.main.CreateObjects()
at CS.main.main()
morning it's dead. I don't know what has changed in that time.
It appears to be dying on the line of code setting the font of a
listview control, ie
Me.lvStatus.Font = New System.Drawing.Font("Microsoft Sans Serif",
9.0!, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
This is the error, any suggestions at all appreciated!
Object reference not set to an instance of an object
at
System.Drawing.SafeNativeMethods.GdipCreateFontFromLogfontW(HandleRef
hdc, Object lf, IntPtr& font)
at System.Drawing.Font.FromLogFont(Object lf, IntPtr hdc)
at System.Drawing.Font.FromHfont(IntPtr hfont)
at System.Windows.Forms.Control.get_DefaultFont()
at System.Windows.Forms.Control.get_Font()
at System.Windows.Forms.ListView..ctor()
at CS.frmMain.InitializeComponent()
at CS.frmMain..ctor()
at CS.main.CreateObjects()
at CS.main.main()