How to check whether a form is loaded or no after it has been hidden using hide method.
AS FAST AS POSSIBLE
Eswar
Printable View
How to check whether a form is loaded or no after it has been hidden using hide method.
AS FAST AS POSSIBLE
Eswar
Why don't you set a bool variable to true in the form's load procedure.. then you could check that variable if it is true, it is loaded, if not, then it isn't...
You can set the Me.tag to hid or shown and check that.
The form won't unload with hide method, if it's not loaded then it will actually load.
Juz use the FindWindow API will do.
Cheers!Code:Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Load Form2
End Sub
Private Sub Command2_Click()
Form2.Show
End Sub
Private Sub Command3_Click()
Form2.Hide
End Sub
Private Sub Command4_Click()
Dim handle As Long
handle = FindWindow(0, "Form2")
If handle <> 0 Then
If Not Form2.Visible Then
MsgBox "Form2 is loaded but not visible."
Else
MsgBox "Form2 is loaded and is visible to all."
End If
Else
MsgBox "Form2 is not loaded"
End If
End Sub
The hide method does not unload the form.
yes, faisalkm. Hide will not unload the form. As from the name hide mean set the form to invisible.