Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable / Disable MenuStrip Items based on a UserAccess Table from Database

Status
Not open for further replies.

RJL1

Technical User
Oct 3, 2002
228
US
Hello,

I am trying to control my Windows Form Menu Item based on a list of access (already in place) by user. When the form loads I am getting the current user name and getting a list of forms the user has access to. So my store procedure return a list like this

Code:
Receiving 1
Receiving 2
Shipping 2

My menu looks something like this

Code:
Receiving
[indent]Receiving 1[/indent]
[indent]Receiving 2[/indent]
[indent]Receiving 3[/indent]
Shipping
[indent]Shipping 1[/indent]
[indent]Shipping 2[/indent]
[indent]Shipping 3[/indent]
Tools
[indent]Tools 1[/indent]
[indent]Tools 2[/indent]
[indent]Tools 3[/indent]

I ant to be able to on load disable all menu items then enable just the menu items the user has access to in this case (Receiving 1, Receiving 2, Shipping 2)

So the final menu would look like this

Code:
Receiving
[indent]Receiving 1[/indent]
[indent]Receiving 2[/indent]
[indent][s]Receiving 3[/s][/indent]
Shipping
[indent][s]Shipping 1[/s][/indent]
[indent]Shipping 2[/indent]
[indent][s]Shipping 3[/s][/indent]
Tools
[indent][s]Tools 1[/s][/indent]
[indent][s]Tools 2[/s][/indent]
[indent][s]Tools 3[/s][/indent]

Thanks for any help with this
RJL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top