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. Programmatically add menu items and sub menus

Programmatically add menu items and sub menus

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasedesignquestion
2 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.
  • P Offline
    P Offline
    penguin5000
    wrote on last edited by
    #1

    Hi, Is it possible to programmatically add menu items and sub menus at run time? I want to read in the contents of a database when my form is loaded, and add two of the database columns to my menu strip. At design time, I've added a "View" menu. One of the options beneath it is, "Filter 1", and another is "Filter 2". I want the column 0 contents of my database to populate a sub menu off the "Filter 1" option, and my column 1 contents to populate a sub menu off "Filter 2". I'm using VB.NET 2005 Express.

    R 1 Reply Last reply
    0
    • P penguin5000

      Hi, Is it possible to programmatically add menu items and sub menus at run time? I want to read in the contents of a database when my form is loaded, and add two of the database columns to my menu strip. At design time, I've added a "View" menu. One of the options beneath it is, "Filter 1", and another is "Filter 2". I want the column 0 contents of my database to populate a sub menu off the "Filter 1" option, and my column 1 contents to populate a sub menu off "Filter 2". I'm using VB.NET 2005 Express.

      R Offline
      R Offline
      Ray Cassick
      wrote on last edited by
      #2

      Yes, You have to define a new MenuItem object and then add it to another MenuItems items collection. You then also have to enable the required event handlers.


      My Blog[^]
      FFRF[^]


      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