Home All Groups Group Topic Archive Search About

MainMenu in MDI problem.

Author
20 Jun 2006 4:23 PM
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!!!!

Author
21 Jun 2006 2:12 PM
Brian Tkatch
PogoWolf wrote:
Show quoteHide quote
> 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.