?
=?ISO-8859-1?Q?J=FCrgen_Roos?=
Hello,
Why does this code not work? The result is an empty entry in the menu
viewing the debugger I see that the property visible is false. I tried
to make visible=true but it still remains false. And for my
understanding why is an entry with visible=false visible with an empty
string despite the property text is filled well?
public class MyMenuItem : ToolStripItem
{
public MyMenuItem(string Name)
{
this.Name = Name;
}
}
private void AddMenuItems()
{
string[] items = { "MenuItem1", "MenuItem2" };
toolStripMenuItem1.DropDownItems.Clear();
foreach (string item in items)
{
MyMenuItem mmi = new MyMenuItem(item);
mmi.Text = item;
//mmi.Click += new EventHandler(mmi_Click);
toolStripMenuItem1.DropDownItems.Add(mmi);
}
}
Why does this code not work? The result is an empty entry in the menu
viewing the debugger I see that the property visible is false. I tried
to make visible=true but it still remains false. And for my
understanding why is an entry with visible=false visible with an empty
string despite the property text is filled well?
public class MyMenuItem : ToolStripItem
{
public MyMenuItem(string Name)
{
this.Name = Name;
}
}
private void AddMenuItems()
{
string[] items = { "MenuItem1", "MenuItem2" };
toolStripMenuItem1.DropDownItems.Clear();
foreach (string item in items)
{
MyMenuItem mmi = new MyMenuItem(item);
mmi.Text = item;
//mmi.Click += new EventHandler(mmi_Click);
toolStripMenuItem1.DropDownItems.Add(mmi);
}
}