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. C#
  4. Generating menu items dynamically from Collection?

Generating menu items dynamically from Collection?

Scheduled Pinned Locked Moved C#
data-structuresquestionannouncement
6 Posts 4 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.
  • T Offline
    T Offline
    TrooperIronMan
    wrote on last edited by
    #1

    I implemented collection of Queue type that I use to save last 10 opened/saved files... so I want to use this list to dynamically update my menu sub items under RecentlyOpenedFiles, any idea how?

    M C L 3 Replies Last reply
    0
    • T TrooperIronMan

      I implemented collection of Queue type that I use to save last 10 opened/saved files... so I want to use this list to dynamically update my menu sub items under RecentlyOpenedFiles, any idea how?

      M Offline
      M Offline
      Mostafa Siraj
      wrote on last edited by
      #2

      assign event with any change in your Queue and update ur menu sub items then

      T 1 Reply Last reply
      0
      • M Mostafa Siraj

        assign event with any change in your Queue and update ur menu sub items then

        T Offline
        T Offline
        TrooperIronMan
        wrote on last edited by
        #3

        OK but first I only know how to add things to menu in designer though I guess it's not that hard...) each should be just call to Open method with parameter file path from queue subitem represent, but how to do second part?

        T 1 Reply Last reply
        0
        • T TrooperIronMan

          OK but first I only know how to add things to menu in designer though I guess it's not that hard...) each should be just call to Open method with parameter file path from queue subitem represent, but how to do second part?

          T Offline
          T Offline
          TrooperIronMan
          wrote on last edited by
          #4

          I would be OK with any solution that solve this problem... doesn't need to be queue... anything that generate this menu is fine...

          1 Reply Last reply
          0
          • T TrooperIronMan

            I implemented collection of Queue type that I use to save last 10 opened/saved files... so I want to use this list to dynamically update my menu sub items under RecentlyOpenedFiles, any idea how?

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            The Menu is a class, it has a collection of items, which are also a class ( which can contain a new list of menu items ).  So, you just need to insert your items into the menu, by creating them one at a time.

            Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

            1 Reply Last reply
            0
            • T TrooperIronMan

              I implemented collection of Queue type that I use to save last 10 opened/saved files... so I want to use this list to dynamically update my menu sub items under RecentlyOpenedFiles, any idea how?

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Have a look at the menu-related code generated by Visual Designer, it shows you how uou can do exactly the same in your code... :)

              Luc Pattyn

              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