我有一个ToolStripMenuItem
called myMenu
。我怎样才能像这样访问它:
/* Normally, I would do: */
this.myMenu... etc.
/* But how do I access it like this: */
String name = myMenu;
this.name...
这是因为我从 XML 文件动态生成 ToolStripMenuItems,并且需要通过动态生成的名称引用 MenuItems。
Use the Control.ControlCollection.Find method.
尝试这个:
this.Controls.Find()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)