Article ID: 201502
Article Last Modified on 5/13/2003
Option Explicit
Private Sub mnuOpen_Click()
Dim frm As Form
Set frm = New Form1
frm.Display Me
End Sub
Public Property Let ShowStatusbar(bShowStatusbar As Boolean)
On Error Resume Next
If bShowStatusbar = True Then
Me.StatusBar1.Visible = True
Else
Me.StatusBar1.Visible = False
End If
End Property
Option Explicit
Private m_ParentForm As MDIForm
Public Sub Display(ParentForm As MDIForm)
Set m_ParentForm = ParentForm
Me.Show
End Sub
Private Sub Form_Resize()
If m_ParentForm Is Nothing Then
Exit Sub
End If
If Me.WindowState = 2 Then
m_ParentForm.ShowStatusbar = False
Else
m_ParentForm.ShowStatusbar = True
End If
End Sub
Option Explicit
Private Sub mnuOpen_Click()
Dim frm As Form
Set frm = New Form1
frm.Display Me
End Sub
Public Property Let ShowStatusbar(bShowStatusbar As Boolean)
On Error Resume Next
Dim i As Integer
Dim bOneMaximized As Boolean
If bShowStatusbar = True Then
If Forms.Count > 0 Then
For i = 0 To Forms.Count - 1
If Forms(i).WindowState = 2 Then
bOneMaximized = True
Exit For
End If
Next i
End If
End If
' Only set it to be true when there is no maximized child form.
If bShowStatusbar = True And bOneMaximized = False Then
Me.StatusBar1.Visible = True
Else
Me.StatusBar1.Visible = False
End If
End Property
Additional query words: kbDSupport
Keywords: kbstatbar kbmdi kbprb KB201502