以编程方式选择和取消选择menustrip .. [英] Programatically select and deselect menustrip..
本文介绍了以编程方式选择和取消选择menustrip ..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何选择menustrip以启用快捷键(无需按下alt键)。
即如何以编程方式使menustrip处于Alt模式&
如何删除来自Alt模式的menustrip。
How to select menustrip to enable shortcuts (without pressing alt key).
i.e. how can i programatically make menustrip to be in Alt mode &
how can i remove menustrip from Alt mode.
推荐答案
你好,如果你在menuStrip1上有例如名为test的ToolStripMenuItem
只需将此代码作为示例放在form_load上以选择他
testToolStripMenuItem:是ToolStripMenuItem的名称:)
Hello if you have for example ToolStripMenuItem named test on your menuStrip1
just put this code for exemple on your form_load to select him
testToolStripMenuItem: is the name of your ToolStripMenuItem :)
private void Form1_Load(object sender, EventArgs e)
{
menuStrip1.Items.Find("testToolStripMenuItem", true).SingleOrDefault().Select();
}
这篇关于以编程方式选择和取消选择menustrip ..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文