H
Henry
I am trying to convert code that worked in a Visual Studio 2003 project to
code that will work in a Vsual Studio 2005 project
and need help.
The following is the VS2003 code:
private void mnuColorItem_Click(
object sender, System.EventArgs e)
{
MenuItem mnuItem = (MenuItem)sender;
//Get the color name from the menu item text
//while removing the & character in that text
rbText.SelectionColor = Color.FromName(
mnuItem.Text.Replace("&", ""));
//Uncheck all menu items inside the color menu
foreach (MenuItem m in mnuItem.Parent.MenuItems)
m.Checked = false;
mnuItem.Checked = true;
}
In VS 2005 this doesn't work because the menu is now a ToolStrip and
MenuItem is now a ToolStripMenuItem...
But when I change that then I can't access the parent because it is
protected. I am not sure what I have to change to get at that data....
That is what I need help with right now.
code that will work in a Vsual Studio 2005 project
and need help.
The following is the VS2003 code:
private void mnuColorItem_Click(
object sender, System.EventArgs e)
{
MenuItem mnuItem = (MenuItem)sender;
//Get the color name from the menu item text
//while removing the & character in that text
rbText.SelectionColor = Color.FromName(
mnuItem.Text.Replace("&", ""));
//Uncheck all menu items inside the color menu
foreach (MenuItem m in mnuItem.Parent.MenuItems)
m.Checked = false;
mnuItem.Checked = true;
}
In VS 2005 this doesn't work because the menu is now a ToolStrip and
MenuItem is now a ToolStripMenuItem...
But when I change that then I can't access the parent because it is
protected. I am not sure what I have to change to get at that data....
That is what I need help with right now.