Results 1 to 7 of 7

Thread: Disable mainmenu items in vb.net

  1. #1
    Join Date
    Feb 2006
    Posts
    4,242
    Rep Power
    0

    Question Enable mainmenu items in vb.net at runtime

    //edit: How do I enable all MDI mainmenu items in vb.net at runtime?
    Last edited by Utech22; Aug 11, 2010 at 05:15 AM. Reason: edit
    |--- www.RealJamaicaEstate.com ™ ---|
    Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
    --- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com

  2. #2
    Join Date
    Feb 2006
    Posts
    4,242
    Rep Power
    0

    Default

    Any help ?
    |--- www.RealJamaicaEstate.com ™ ---|
    Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
    --- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com

  3. #3
    Join Date
    Apr 2005
    Posts
    1,333
    Rep Power
    0

    Default

    Not to sound like a killjoy or discourage you (I know nothing about .net) but did you try google?

    This is what you are looking for?
    The fox was probably right - they could have been sour grapes.

  4. #4
    Join Date
    Feb 2006
    Posts
    4,242
    Rep Power
    0

    Default

    Google is my library.
    |--- www.RealJamaicaEstate.com ™ ---|
    Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
    --- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com

  5. #5
    Join Date
    Feb 2005
    Posts
    85
    Rep Power
    0

    Default

    Me.MenuStrip.Enabled = True 'for all items

    or


    Me.MenuStrip.Items(0).Enabled = True 'for 1st item
    Me.MenuStrip.Items(1).Enabled = True 'for 2nd item
    Me.MenuStrip.Items(2).Enabled = True 'for 3rd item
    .
    .
    .
    Last edited by ToxXxic; Sep 1, 2010 at 03:04 PM.
    Code King aka Code WizZzard: Motivated By The Challenge, Driven By The Will To Succeed.

    In The Land Of Programmers, The Code WizZzard Is KING. Sen on anything VB

  6. #6
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    if its a sub menu that you want to hide items from, based on some current criteria, you can subscribe to the Popup event of the parent menu (or submenu) item, and set the visible (or enabled) property of the relevant sub menu item(s)

    Just before a MenuItem is shown, the Popup event is fired to give you time to decide whether to show, check, or change the appearance of a menu item

    full description is here samplechapter : introduction-to-windows-forms
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  7. #7
    Join Date
    Aug 2005
    Posts
    518
    Rep Power
    0

    Default

    i try someting like that and did someting like this...

    My application check if the connection was available the run the following either enable or disable all MDI children in the parent accordingly

    this is private sub I created... NOTE i got the RequestState from the network check and pass and true or false (boolean) into the sub when i am calling it

    Private Sub Disable_Enable_MDIForms(RequestState as Boolean)
    For Each app As Form In Me.MdiChildren
    app.Enabled = RequestState
    app.MainMenuStrip.Enabled = RequestState
    Next
    End Sub

    hope it help
    Last edited by Overkill; Oct 13, 2010 at 04:50 PM.
    Why fight Information Technology when you can outsource IT

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •