Click here to Skip to main content
15,921,174 members
Home / Discussions / C#
   

C#

 
GeneralRe: printing forms Pin
TWatson474-Aug-06 4:50
TWatson474-Aug-06 4:50 
GeneralRe: printing forms Pin
Not Active4-Aug-06 6:01
mentorNot Active4-Aug-06 6:01 
AnswerRe: printing forms Pin
Vipin Venugopal3-Aug-06 17:53
Vipin Venugopal3-Aug-06 17:53 
GeneralRe: printing forms Pin
Not Active4-Aug-06 6:00
mentorNot Active4-Aug-06 6:00 
QuestionRegistry saving Vs. XML Saving Pin
Saamir3-Aug-06 11:59
Saamir3-Aug-06 11:59 
AnswerRe: Registry saving Vs. XML Saving Pin
eggie53-Aug-06 14:00
eggie53-Aug-06 14:00 
Questiona question about datagridview ? Pin
cmpeng343-Aug-06 11:35
cmpeng343-Aug-06 11:35 
AnswerRe: a question about datagridview ? Pin
AB77713-Aug-06 19:04
AB77713-Aug-06 19:04 
Questionhow to fill the user/pass fields in the popUp window of the HTACCESS from c# [modified] Pin
vedmack3-Aug-06 11:11
vedmack3-Aug-06 11:11 
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 

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.