|
Определить, загружена ли форма |
|
|
Добавьте 2 CommandButton и другую форму (Form 2) Function FormLoadedByName(FormName As String) As Boolean
Dim i As Integer, fnamelc As String
fnamelc = LCase$(FormName)
FormLoadedByName = False
For i = 0 To Forms.Count - 1
If LCase$(Forms(i).Name) = fnamelc Then
FormLoadedByName = True
Exit Function
End If
Next
End Function
Private Sub Command1_Click()
'Замените 'Form2' именем формы, про которую хотите
знать...
If FormLoadedByName("Form2") = True Then
MsgBox "Форма загружена"
Else
MsgBox "Форма не загружена"
End If
End Sub
Private Sub Command2_Click()
Load Form2
End Sub
|
|
|
|
|
|
|