Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. vb.net visibility o form objects

vb.net visibility o form objects

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    classy_dog
    wrote on last edited by
    #1

    In a VB.NET 2008 desktop application, I need to add some initial selections with a corresponding button to the 'main' form, before any of the normal processing is allowed to occur. Thus due to that fact, I have the following questions to ask: 1. This application is using a System.Windows.Forms.MainMenu and I would like the 'File' option to not display until the 'new' button is clicked? If this is possible, would you showe me the code for this to occur? 2. If option #1 is not possible, is there a way to make System.Windows.Forms.MainMenu not display until the the 'new' button is clicked? If this is possible, would you show me the code for this to occur? 3. In this application there is code that adds menu items with logic like,

     MainMenu1.MenuItems(0).MenuItems.Add("New Item", New EventHandler(AddressOf ClickHandler))
      MainMenu1.MenuItems(0).MenuItems.Add("-") 
    

    Is there a way to modify the order of list of menuitems after the menu items have already been created? Would I need to delete the menuitems at that point and create the menuitems again? Thus would you show me the code for this option and/or let me know if this option is not possible?

    L 1 Reply Last reply
    0
    • C classy_dog

      In a VB.NET 2008 desktop application, I need to add some initial selections with a corresponding button to the 'main' form, before any of the normal processing is allowed to occur. Thus due to that fact, I have the following questions to ask: 1. This application is using a System.Windows.Forms.MainMenu and I would like the 'File' option to not display until the 'new' button is clicked? If this is possible, would you showe me the code for this to occur? 2. If option #1 is not possible, is there a way to make System.Windows.Forms.MainMenu not display until the the 'new' button is clicked? If this is possible, would you show me the code for this to occur? 3. In this application there is code that adds menu items with logic like,

       MainMenu1.MenuItems(0).MenuItems.Add("New Item", New EventHandler(AddressOf ClickHandler))
        MainMenu1.MenuItems(0).MenuItems.Add("-") 
      

      Is there a way to modify the order of list of menuitems after the menu items have already been created? Would I need to delete the menuitems at that point and create the menuitems again? Thus would you show me the code for this option and/or let me know if this option is not possible?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1. Set the menu item's visibility property to False so it will not show on the form. You then set it to True when required. 2. NA 3. You would need to delete them and re-insert them.

      C 1 Reply Last reply
      0
      • L Lost User

        1. Set the menu item's visibility property to False so it will not show on the form. You then set it to True when required. 2. NA 3. You would need to delete them and re-insert them.

        C Offline
        C Offline
        classy_dog
        wrote on last edited by
        #3

        In response to your answers, I have the following questions: "Set the menu item's visibility property to False so it will not show on the form. You then set it to True when required." I placed the following code in the application, and it did not work:

        MainMenu1.MdiListItem.Visible = False

        Thus can you show me the code to Set the menu item's visibility property to False? Also would you show me the code on how to 'You would need to delete them and re-insert them' the menuitems? The menu items are currently created in the gui and not in code.

        L 1 Reply Last reply
        0
        • C classy_dog

          In response to your answers, I have the following questions: "Set the menu item's visibility property to False so it will not show on the form. You then set it to True when required." I placed the following code in the application, and it did not work:

          MainMenu1.MdiListItem.Visible = False

          Thus can you show me the code to Set the menu item's visibility property to False? Also would you show me the code on how to 'You would need to delete them and re-insert them' the menuitems? The menu items are currently created in the gui and not in code.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          classy_dog wrote:

          can you show me the code to Set the menu item's visibility property to False?

          The code you have should do it, I just tested it on my sample and it works fine. The menu items are created in code within the form designer, whose code can be viewed, so you can see how it is created. You can also read the MSDN documentation[^] for full details.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups