MainMenu in MDI problem.

P

PogoWolf

Hey all,
I have a MDI interface going on, with a MainMenu object in the
Container Form.
The FIRST screen that pops MDI is the 'Login' form.

the problem is, the MainMenu is apart of the container.. but I don't
want it to show up
until the user has logged in.

I've created a function in the Container Form in order to handle this:
Public Sub FixMainMenu(ByVal State As Boolean)

For Each item As MenuItem In Me.MainMenu1.MenuItems
item.Visible = State
Next
Me.Refresh()
End Sub


and when loaded EACH form calls a 'InitializeForm' sub that gets the
stored Size and location of the the form. Since this sub is called by
each Form, I thought it would be a good idea to place the 'hide/unhide
menu'
code:

If gConn Is Nothing Then
frmContainer.FixMainMenu(False)
Else
frmContainer.FixMainMenu(True)
End If
(Where gConn is the connection object.. if it's nothing.. the user
isn't logged in)

the problem is... Where as this code above is fired..
the mainmenu object on the container form is NOT changed...


any ideas?

Thanks!!!!
 
B

Brian Tkatch

PogoWolf said:
Hey all,
I have a MDI interface going on, with a MainMenu object in the
Container Form.
The FIRST screen that pops MDI is the 'Login' form.

the problem is, the MainMenu is apart of the container.. but I don't
want it to show up
until the user has logged in.

I've created a function in the Container Form in order to handle this:
Public Sub FixMainMenu(ByVal State As Boolean)

For Each item As MenuItem In Me.MainMenu1.MenuItems
item.Visible = State
Next
Me.Refresh()
End Sub


and when loaded EACH form calls a 'InitializeForm' sub that gets the
stored Size and location of the the form. Since this sub is called by
each Form, I thought it would be a good idea to place the 'hide/unhide
menu'
code:

If gConn Is Nothing Then
frmContainer.FixMainMenu(False)
Else
frmContainer.FixMainMenu(True)
End If
(Where gConn is the connection object.. if it's nothing.. the user
isn't logged in)

the problem is... Where as this code above is fired..
the mainmenu object on the container form is NOT changed...


any ideas?

Thanks!!!!

Can you try enable = false intead?

B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top