.Visible = False not working...

  • Thread starter Thread starter Rob R. Ainscough
  • Start date Start date
R

Rob R. Ainscough

I can't seem to make my form not visible. During the Load event I
specifically set Me.Visible = False but the form still displays?

Any suggestions ?
 
Rob R. Ainscough said:
I can't seem to make my form not visible. During the Load event I
specifically set Me.Visible = False but the form still displays?

It's too late at this point. The 'Load' event is called directly prior to
making the form visible, regardless of the value of the 'Visible' property.
Don't call the form's 'Show'/'ShowDialog' method in order to prevent it from
getting visible.
 
Can't use that setting as the project is started from Sub Main.

Example:

Module MyStartup

Sub Main()

Dim myForm as New Form1

' Do some pre-processing...(code not shown)

Application.EnableVisualStyels()
Application.Run(myForm)

End Sub

End Module
 
Rob R. Ainscough said:
How about using the Activated event to set Visible ?

I suggest to describe the scenario in more detail. Maybe there is even a
better solution, for example, performing the tests on instantiaton instead
of performing it when the form is intended to get visible.
 
I could, but I'd have to change a lot of code, not sure I want to do that.
The Activated event is working well enough.

Thanks, Rob.
 
Back
Top