Reputation: 1659
Please check below screen shot
For Example:
I am having a String. Value of that string is "Bank" I need some logic that disable the menu with name "Bank"
I hope you got my question.
Upvotes: 0
Views: 618
Reputation: 1659
I have solved my question
Answer is like below
foreach (ToolStripMenuItem d in fileToolStripMenuItem.DropDownItems)
{
if (d.Name == "saveToolStripMenuItem")
{
d.Enabled = true;
}
}
Upvotes: 0
Reputation: 4520
Can you find name of your menu ITEM inside menu.Open Form in design view select your menu item and hit F4 (to get properties window) on properties you should be able to see name of your item. You can try hide that on properites menu. Or you need somewhere in code behind to do that through code.
Here is ss of it
Upvotes: 0
Reputation: 26209
You need to just set the Enabled
property of your menuItem Zone
to false
Try This:
yourMenuItem.Enabled = false;
here yourMenuItem
is the name
of the menu item zone
Upvotes: 0
Reputation: 956
Since your question is VERY vague, this answer might be wrong. But what I think you want is to disable a menu item at certain times.
menuitem.IsEnabled = false;
Upvotes: 1