|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MainMenu in MDI problem.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!!!! PogoWolf wrote:
Show quoteHide quote > Hey all, Can you try enable = false intead?> 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.
More VS2003 to VS2005 questions
difference between imports-implements-inherits Write to an XML file using data from an SQLserver table Master Page Template new line in datagrid cell Calling .Net DLL functions in Excel 2003 How to update application settings in vb.net code ContextMenuStrip newbie script question Dang, trivial problem! |
|||||||||||||||||||||||