I assume you're loading the "Startup" form from sub_main?
I do something simular for a splash screen.
I'll just copy the class here, but you should get the point... In SubMain I
call Splash.Show
And later in the app I can Splash.Close, you should be able to do something
simular to get SpecialForm.Vis ible.
---------------------------------------------------------
Public Class Splash
Private Shared splashForm As SplashScreen
Private Shared splashThread As Thread
Shared Sub ShowThread()
If splashForm Is Nothing Then
splashForm = New SplashScreen
End If
Application.Run (splashForm)
End Sub
Public Shared Sub Show()
If Not splashThread Is Nothing Then
Return
End If
splashThread = New Thread(New ThreadStart(Add ressOf
Splash.ShowThre ad))
splashThread.Cu rrentCulture =
Thread.CurrentT hread.CurrentCu lture
splashThread.Cu rrentUICulture =
Thread.CurrentT hread.CurrentUI Culture
splashThread.Is Background = True
splashThread.Ap artmentState = ApartmentState. STA
splashThread.St art()
While splashForm Is Nothing
Thread.Sleep(Ne w TimeSpan(100))
End While
End Sub
Public Shared Sub Close()
If splashThread Is Nothing Then Return
If splashForm Is Nothing Then Return
Try
If splashForm.IsDi sposed Then Return
If splashForm.Hand le.Equals(IntPt r.Zero) Then Return
splashForm.Invo ke(New MethodInvoker(A ddressOf
splashForm.Clos e))
Catch ex As Exception
Logger.AddLogEx ception(ex,
System.Reflecti on.MethodBase.G etCurrentMethod ().DeclaringTyp e.ToString)
splashThread = Nothing
splashForm = Nothing
End Try
End Sub
Public Shared Property Status() As String
Get
If splashForm Is Nothing Then Throw New
InvalidOperatio nException("Spl ash Form not on screen")
Return splashForm.Stat usInfo
End Get
Set(ByVal Value As String)
If splashForm Is Nothing Then Return
splashForm.Stat usInfo = Value
End Set
End Property
Public Shared Property Version() As String
Get
If splashForm Is Nothing Then Throw New
InvalidOperatio nException("Spl ash Form not on screen")
Return splashForm.Vers ionInfo
End Get
Set(ByVal Value As String)
If splashForm Is Nothing Then Return
splashForm.Vers ionInfo = Value
End Set
End Property
Private Sub New()
End Sub
End Class
Create a public property in the form you want to show or hide that does
visibility...
Public Property Visible As Boolean
"BrianDH" <Br*****@discus sions.microsoft .com> wrote in message
news:34******** *************** ***********@mic rosoft.com...
Hi
I have an application with 3 windows forms. One of which I load at
startup
but hide, then show/hide based on users click. How can I test to see if
the
windows is hidden, or is at the moment being shown?
Thanks
BrianDH