Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I have a log in form, when i log in appears a menu form and i want to hide some menustripitems as admin for example!

how i can do this?
Posted

1 solution

On the login form load event, you can do an iteration like below to disable menu items

C#
for (int i = 0; i <= MenuStrip1.Items.Count - 1; i++) {
    if ("admin" == MenuStrip1.Items(i).Tag) {
        MenuStrip1.Items(i).Enabled = false;
    }

}


thanks
derin
 
Share this answer
 
Comments
RaisKazi 28-Mar-12 20:53pm    
My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900