按下按钮即可更改所有工具tripmenuitem文本 [英] change all toolstripmenuitem text by pressing a button
问题描述
亲爱的所有人,
我正在尝试更改所有菜单项的文本.我想单击一个按钮,以便所有菜单项的文本都将被更改.
我一直想这样做,直到感到沮丧为止.
请尝试帮助我
我能达到的最后一件事:
tsmi =(ToolStripMenuItem)sender;
foreach(tsmi.DropDownItems中的ToolStripItem t)
{
//MessageBox.Show(mainMenu.GetNextControl(mainMenu,true).Text.ToString());
MessageBox.Show(t.Text);
}
也没有给出结果
请帮助!
Dears All,
I''m trying to change the text for all menu items. I want to click on a button so all menu items text will be changed.
I''m trying to do so until I got frustrated.
Plz try to help me
Last thing I could reach:
ToolStripMenuItem tsmi = (ToolStripMenuItem)sender;
foreach (ToolStripItem t in tsmi.DropDownItems)
{
//MessageBox.Show(mainMenu.GetNextControl(mainMenu, true).Text.ToString());
MessageBox.Show(t.Text);
}
Also it is not giving result
plz help!
推荐答案
您正在迭代所选菜单项下包含的所有项.那是你要的吗 ? 不起作用"是什么意思?您看到了什么,它与您的预期有何不同?
You''re iterating over all the items that are contained under the menu item that was selected. Is that what you want ? What does ''it doesn''t work'' mean ? What do you see, and how does it differ from what you expected ?
这篇关于按下按钮即可更改所有工具tripmenuitem文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!