Check if the Form was Shown

Posted by serhio on Stack Overflow See other posts from Stack Overflow or by serhio
Published on 2010-06-07T11:58:46Z Indexed on 2010/06/07 12:02 UTC
Read the original article Hit count: 168

Filed under:
|

.NET2
I have a panelChild that is on the panelParent that is in the Form1.

When panelParent_Resizes panelChild does a panelChild_HeavyOperation.

panelParent rezizes multiple times in InitializeComponent of Form1 and consume a lot of time because of panelChild_HeavyOperation.

I decided to reduce the panelChild_HeavyOperation only when the Form1 is shown and has a defined size.

by eg. like this:

Sub panelChild_HeavyOperation
 If not FindForm().IsShown then Reuturn
 ' .... '
End Sub 

The problem is that IsShown does not exist on a Form...

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms