Link to home
Start Free TrialLog in
Avatar of yuvaratna
yuvaratna

asked on

Changing The order Of menustrip Dynamically

i am working on a windows application whwere my menustrip has say 6items. if the logged in user is "Admin" , i wanted to show the 6th item in the list as the first one...I mean i wanted to change the order of menu items displayed. what is the property that i can use to change the Order of menu strip.
Avatar of ChloesDad
ChloesDad
Flag of United Kingdom of Great Britain and Northern Ireland image

Assuming that you are working in vb.net then it is straight forward

        Me.MenuStrip1.Items.Clear()

        Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.StripMenuItemHeader6, Me.StripMenuItemHeader1, Me.StripMenuItemHeader2, me.StripMenuItemHeader3, me.StripMenuItemHeader4, me.StripMenuItemHeader5})

change the Me.StripMenuItemHeaderx to your own items. The sub items will move automatically with the headers.
Avatar of yuvaratna
yuvaratna

ASKER

i tried This..But the order of menu items didnt change...
ASKER CERTIFIED SOLUTION
Avatar of ChloesDad
ChloesDad
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial