A
Armin Zingler
Hi,
why are exceptions in OnResize just ignored as if nothing happened?
Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
MyBase.OnResize(e)
If f_Bitmap IsNot Nothing Then
f_Bitmap.Dispose()
End If
Trace.WriteLine("OnResize: before") '******* reached
f_Bitmap = New Bitmap(ClientSize.Width, ClientSize.Height)
Trace.WriteLine("OnResize: after") '******* NOT reached
End Sub
My fault was that ClientSize is zero with a minimzed Form, but
why is the exception at "New Bitmap(0,0)" just ignored? This is
a big problem because f_Bitmap still points to the previous disposed
Bitmap, which leads to an exception later.
why are exceptions in OnResize just ignored as if nothing happened?
Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
MyBase.OnResize(e)
If f_Bitmap IsNot Nothing Then
f_Bitmap.Dispose()
End If
Trace.WriteLine("OnResize: before") '******* reached
f_Bitmap = New Bitmap(ClientSize.Width, ClientSize.Height)
Trace.WriteLine("OnResize: after") '******* NOT reached
End Sub
My fault was that ClientSize is zero with a minimzed Form, but
why is the exception at "New Bitmap(0,0)" just ignored? This is
a big problem because f_Bitmap still points to the previous disposed
Bitmap, which leads to an exception later.