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. MRU Button List in C#

MRU Button List in C#

Scheduled Pinned Locked Moved C#
csharpc++graphicsdocker
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.
  • A Offline
    A Offline
    Alisaunder
    wrote on last edited by
    #1

    Hello everyone. I'm trying to create an MRU button list, similar to the one used in Office 2007 software. I've searched for months and all I can find it MRU list examples using menuItem and menuToolbars. I can't see how this would really be that much more difficult but for some reason, I keep drawing a blank. I have a container like a panel control that will allow for buttons to be dynamically added to it. Any help would be appreciated. Preferably in C# but I can convert from C++ and Visual Basic as well. Thankyou.

    C 1 Reply Last reply
    0
    • A Alisaunder

      Hello everyone. I'm trying to create an MRU button list, similar to the one used in Office 2007 software. I've searched for months and all I can find it MRU list examples using menuItem and menuToolbars. I can't see how this would really be that much more difficult but for some reason, I keep drawing a blank. I have a container like a panel control that will allow for buttons to be dynamically added to it. Any help would be appreciated. Preferably in C# but I can convert from C++ and Visual Basic as well. Thankyou.

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

      Well, all you need to do, is track what was recently used, and add to your container, right ?

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      A 1 Reply Last reply
      0
      • C Christian Graus

        Well, all you need to do, is track what was recently used, and add to your container, right ?

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        A Offline
        A Offline
        Alisaunder
        wrote on last edited by
        #3

        I need to figure out how to create the button dynamically, which I have. But creating a click event for the buttons dynamically is giving me trouble.

        A 1 Reply Last reply
        0
        • A Alisaunder

          I need to figure out how to create the button dynamically, which I have. But creating a click event for the buttons dynamically is giving me trouble.

          A Offline
          A Offline
          Alisaunder
          wrote on last edited by
          #4

          here's my current code to add a button:

             public void updateMRU()
              {
                  // add a new button
                  ButtonItem button = new ButtonItem(filename,"&1 " + filename);
                  button.ImagePaddingHorizontal = 8;
                  button.Tag = filename;
                  menuFileMRU.SubItems.Add(button);
                  //button.Click += new EventHandler(button\_Click);     
              }
          

          The last line to assign an event handler gives me an error before compilation. The name button_Click does not exist in the current context. Every example I've found to create a button and event handler looks like this. If I remark that line out my button does appear in the correct spot with all the information. Why can't I get the EventHandler to work? By the way I'm using DotNetBar and placing the control inside a GalleryContainer, but it allows for buttons and according to Dev Components their Buttonitem is just an overloaded Button control.

          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