ToolStripMenuItem ordering

G

Guest

The application I am working on has different dynamically loaded modules.
Upon initializing a module, the module can add ToolStripMenuItems via an
object model I am in the process of finalizing.

Since one module doesn't know about another module, and what menu items have
been added, I need a way to order ToolStripMenuItems since they automatically
sort in the order they are added.

Does the MenuStrip contain any properties/methods which perform this
functionality for me?

I know I can do this by creating a sort method and adding some sort of
sortkey to my ToolStripMenuItems (MergeIndex for example) and then reording
the items in the MenuStrip.Controls collection based on that, but this seems
like something that I'm sure I'm not the first to try.

In short my question is, is there an existing solution for sorting
dynamically added ToolStripMenuItems?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top