30 pts.
 Problem in accessing menustrip items in VB.Net 2005.
Hi everyone, I'm working with VB.Net 2005(.Net framework 2.0). I am having a problem in accessing the items in a menustrip of a form. Suppose there is an item in a menustrip named FILE. Under the FILE item there are 3 subitems- OPEN, SAVE and EXIT. Now, I wanna access and disable the 2nd subitem i.e. SAVE with its index value. In VB.Net 2002 it could be done by the following code: Me.Menu.MenuItems(0).MenuItems(1).Enabled=False The first 'MenuItems(0)' refers to the item- FILE. The latter one refers to the 2nd item of FILE (Array concept). But in VB.Net 2005 I can write the above code upto.... Me.MenuStrip1.MenuItems(0) After that I cannot access any subitem. Can anybody provide me the code snippet for that?

Software/Hardware used:
ASKED: December 24, 2007  1:58 PM
UPDATED: February 22, 2008  5:28 AM

Answer Wiki:
Each item in the submenu should have it's own name, and you should be able to reference it directly by it's same and disable it with .enabled = false.
Last Wiki Answer Submitted:  December 26, 2007  11:46 pm  by  Denny Cherry   64,550 pts.
All Answer Wiki Contributors:  Denny Cherry   64,550 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Were you able to fix the problem or do you still need a code snippet?

 64,550 pts.