MainMenu in MDI problem.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PogoWolf

    #1

    MainMenu in MDI problem.

    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(ByV al State As Boolean)

    For Each item As MenuItem In Me.MainMenu1.Me nuItems
    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.Fi xMainMenu(False )
    Else
    frmContainer.Fi xMainMenu(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!!!!

  • Brian Tkatch

    #2
    Re: MainMenu in MDI problem.


    PogoWolf wrote:[color=blue]
    > 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(ByV al State As Boolean)
    >
    > For Each item As MenuItem In Me.MainMenu1.Me nuItems
    > 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.Fi xMainMenu(False )
    > Else
    > frmContainer.Fi xMainMenu(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!!!![/color]

    Can you try enable = false intead?

    B.

    Comment

    Working...