Hi All..
I'm trying to setup a menustrip that will show different options acording to the logged in user security clearence. I'm using vb2005 and this is a winform app.
I've build the menustrip with all its options.
But when I try to hide the different menu items (visible = False), I get an error saying "Object reference not set to an instance of an object"
If I use:
I don't get any error message and the menu item behavior doesn't change. The item stays visible. I have even tried setting the visible to false in the menustrip designer and then at run time set the behavior to true with no change in the menu.
This is all done within the same winform.
Thanks for the help..
I'm trying to setup a menustrip that will show different options acording to the logged in user security clearence. I'm using vb2005 and this is a winform app.
I've build the menustrip with all its options.
Code:
Me.MenuStrip1.Items.Item("User Manager").Visible = False
But when I try to hide the different menu items (visible = False), I get an error saying "Object reference not set to an instance of an object"
If I use:
Code:
UserManagerToolStripMenuItem
I don't get any error message and the menu item behavior doesn't change. The item stays visible. I have even tried setting the visible to false in the menustrip designer and then at run time set the behavior to true with no change in the menu.
This is all done within the same winform.
Thanks for the help..