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.Visible.
---------------------------------------------------------
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(AddressOf
Splash.ShowThread))
splashThread.CurrentCulture =
Thread.CurrentThread.CurrentCulture
splashThread.CurrentUICulture =
Thread.CurrentThread.CurrentUICulture
splashThread.IsBackground = True
splashThread.ApartmentState = ApartmentState.STA
splashThread.Start()
While splashForm Is Nothing
Thread.Sleep(New 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.IsDisposed Then Return
If splashForm.Handle.Equals(IntPtr.Zero) Then Return
splashForm.Invoke(New MethodInvoker(AddressOf
splashForm.Close))
Catch ex As Exception
Logger.AddLogException(ex,
System.Reflection.MethodBase.GetCurrentMethod().De claringType.ToString)
splashThread = Nothing
splashForm = Nothing
End Try
End Sub
Public Shared Property Status() As String
Get
If splashForm Is Nothing Then Throw New
InvalidOperationException("Splash Form not on screen")
Return splashForm.StatusInfo
End Get
Set(ByVal Value As String)
If splashForm Is Nothing Then Return
splashForm.StatusInfo = Value
End Set
End Property
Public Shared Property Version() As String
Get
If splashForm Is Nothing Then Throw New
InvalidOperationException("Splash Form not on screen")
Return splashForm.VersionInfo
End Get
Set(ByVal Value As String)
If splashForm Is Nothing Then Return
splashForm.VersionInfo = 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*****@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.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