
Need help with object references
If I understood correctly, you have a menu where each option represents a
form the user can load or unload.
So, if you have a menu named 'mnuTest', with an option 'opcForm1' in an MDI
parent form named 'frmMain', you can place a check mark next to the
'opcForm1' option by using:
Private Sub opcform1_Click()
Form1.Show
frmMain.opcform1.Checked = True
End Sub
where Form1 is an MDI child form.
to remove the check mark, you can use:
Private Sub Form_Unload(Cancel As Integer)
frmMain.opcform1.Checked = False
End Sub
in the MDI child form.
I've tested this solution briefly and it seems to work
vmlf.
Quote:
>Looking through my VB4 projects, I can't find code where I have done this
>before. It is too simple to have to resort to the newsgroups, but I can't
get
>it figured out. I'm using VB5 Enterprise. In my menu (on an MDI form
named
>frmMain) I have a list os possible windows the user can open. If a window
is
>open it has a check beside it. When a user closes a window I want the
check to
>disappear. Here is the code I am using.
>Private Sub Form_Unload(cancel as Integer)
> frmMain.mnuInfoForm.Checked = False
>End Sub
>When executing I get a run time error 426. The error message says "Only
one
>MDI Form allowed". I've tried using "MDIForm.mnuInfoForm.Checked = False"
>and I get the object required error. Any body know what I'm doing wrong?
I
>know I've done this before in VB4, I just can't find any examples of it at
>home, and I no longer work where I did it.
>Tim Crockett
>Paisley Rainbow Studios