-
I'm trying to create a status bar that will show the date, time and currently active child form. I can get the date and time without any problems, but getting the caption of the active child form is causing me some problems. Here is the code that I'm using:
Private Sub MDIForm_Load()
Dim pnl As Panel
Dim sts As String
With sts
.Text = MDIForm1.ActiveForm.Caption
End With
With stsStatus.Panels
Set pnl = .Add(, , , sbrTime)
Set pnl = .Add(, , , sbrDate)
Set pnl = .Add(1, , "Test")
End With
End Sub
Can anyone see where I'm going wrong, or maybe suggest a different approach? Thanks in advance.
-
the MDIForm_Load event only happens when the parent form is loaded....try putting that code into the Form_Activate or Form_Paint of your child forms
-
Thanks a lot, did that and it worked fine.