Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
QuestionDropdown Buttons Pin
SoftcodeSoftware3-Aug-06 11:03
SoftcodeSoftware3-Aug-06 11:03 
AnswerRe: Dropdown Buttons Pin
Thomas Stockwell7-Aug-06 12:51
professionalThomas Stockwell7-Aug-06 12:51 
QuestionB&W Image filter Pin
Rogenator3-Aug-06 9:40
Rogenator3-Aug-06 9:40 
AnswerRe: B&W Image filter Pin
Ennis Ray Lynch, Jr.3-Aug-06 9:48
Ennis Ray Lynch, Jr.3-Aug-06 9:48 
QuestionWaitForInputIdle Question Pin
Mridang Agarwalla3-Aug-06 9:32
Mridang Agarwalla3-Aug-06 9:32 
QuestionHow to know if Word is running under Outlook in Add-in Pin
zhihongwang3-Aug-06 9:15
zhihongwang3-Aug-06 9:15 
Questiona little further with System.Threading.Interlocked class Pin
mikewinny3-Aug-06 8:58
mikewinny3-Aug-06 8:58 
QuestionHow to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 6:53
glima3-Aug-06 6:53 
Hello!

How do you reorder ToolStripMenuItems in MenuStrip at runtime?

Here's some sample code:

//create the MenuStrip here and add a File menu with an Exit MenuItem on it.
MenuStrip ms = new MenuStrip();
ToolStripMenuItem file = new ToolStripMenuItem("File");
ToolStripMenuItem fileExit = new ToolStripMenuItem("Exit");
file.DropDownItems.Add(fileExit);
ms.Items.Add(file);

//Add a Print MenuItem to the File Menu
ToolStripMenuItem filePrint = new ToolStripMenuItem("Print");
file.DropDownItems.Add(filePrint);

At this point, the File menu will have the Exit menu item, and then the Print menu item below it. How do you change the order, and move the Print menu item to the top?

Background: I'm creating a _MenuStrip control that inherits from MenuStrip, and will have default MenuItems for all menus in the application, such as File/Exit, and Help/About, etc. I plan on creating additional MenuStrips that inherit from my base _MenuStrip control, and I will need to add and remove MenuItems at runtime.

Thanks!


Gary
AnswerRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
Judah Gabriel Himango3-Aug-06 8:48
sponsorJudah Gabriel Himango3-Aug-06 8:48 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 10:23
glima3-Aug-06 10:23 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 10:28
glima3-Aug-06 10:28 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
Stefan Troschuetz3-Aug-06 10:36
Stefan Troschuetz3-Aug-06 10:36 
QuestionA source (example) to do... Help ! Pin
bttf3-Aug-06 6:50
bttf3-Aug-06 6:50 
AnswerRe: A source (example) to do... Help ! Pin
Not Active3-Aug-06 7:40
mentorNot Active3-Aug-06 7:40 
GeneralRe: A source (example) to do... Help ! Pin
bttf5-Aug-06 21:47
bttf5-Aug-06 21:47 
GeneralRe: A source (example) to do... Help ! Pin
bttf7-Aug-06 8:53
bttf7-Aug-06 8:53 
QuestionA Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 6:40
RizwanSharp3-Aug-06 6:40 
JokeRe: A Little Problem in Single Instance Implementaion!!! Pin
Not Active3-Aug-06 7:44
mentorNot Active3-Aug-06 7:44 
GeneralRe: A Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 7:47
RizwanSharp3-Aug-06 7:47 
AnswerRe: A Little Problem in Single Instance Implementaion!!! Pin
Josh Smith3-Aug-06 8:49
Josh Smith3-Aug-06 8:49 
GeneralRe: A Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 19:36
RizwanSharp3-Aug-06 19:36 
QuestionGetting the installation directory in a Deployment project Pin
GazzaJ3-Aug-06 6:31
GazzaJ3-Aug-06 6:31 
QuestionStrange Problem Regarding TabIndex Pin
RizwanSharp3-Aug-06 6:22
RizwanSharp3-Aug-06 6:22 
AnswerRe: Strange Problem Regarding TabIndex Pin
Ingo3-Aug-06 6:35
Ingo3-Aug-06 6:35 
GeneralRe: Strange Problem Regarding TabIndex Pin
RizwanSharp3-Aug-06 6:46
RizwanSharp3-Aug-06 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.