tags:

views:

24

answers:

1

Hi,

I have a problem and that is related to Menus in VB.NET. The problem is as follows:

I have created a menu called "Test" and sub menus in that called "Test 1", "Test2", "Test 3", "Test 4" and "Test 5". The property "NAME" of these sub menus are "M1", "M2", "M3", "M4" and "M5".

All these menus are disabled at runtime and in the MDI form, i have called a procedure to get the rights of a user and sore these in a list box in the MDI Form. Assume that the List Box contains "M1" and "M5". I need to activate only these menus.

Can anyone please help me on this matter.

+1  A: 

This code will disable all menus in the ListBox.

For Each i As String In ListBox1.Items
   MenuItem1.DropDownItems(i).Enabled = False
Next
Jeff Stock
Thanks a lot Jeff, its working fine. Appreciate your kindness in helping.
George Trevour