本文整理汇总了C#中System.Windows.Forms.MenuStrip.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# MenuStrip.Invoke方法的具体用法?C# MenuStrip.Invoke怎么用?C# MenuStrip.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.MenuStrip
的用法示例。
在下文中一共展示了MenuStrip.Invoke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetMenu
private void SetMenu(MenuStrip Info)
{
if (Info.InvokeRequired)
{
menuDelegate DDD = new menuDelegate(SetMenu);
Info.Invoke(DDD, new object[] { Info });
}
else
{
экспортToolStripMenuItem.Enabled = true;
вTxtToolStripMenuItem.Enabled = true;
вXSLToolStripMenuItem.Enabled = true;
}
}
示例2: LoadEditorForm
public override void LoadEditorForm(TabControl ScriptsTab, MenuStrip mainMenu)
{
ScriptsTab.TabPages.Add(AddEditorTab());
this.editorText.KeyPress += new KeyPressEventHandler(editorText_KeyPress);
mainMenu.Invoke((MethodInvoker)delegate()
{
scriptMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
loadScript, unloadScript, newScript, saveScript});
int i = 1;
foreach (String file in icechatVBScripts.listScripts)
{
if (File.Exists(this.CurrentFolder + Path.DirectorySeparatorChar + "Scripts" + Path.DirectorySeparatorChar + file))
{
System.Diagnostics.Debug.WriteLine("loading script file into editor and add to menu: " + file);
ToolStripMenuItem s = new ToolStripMenuItem(file);
s.Name = file;
s.Click += new EventHandler(loadedScript_Click);
s.Tag = "saved";
//load the first one in the editor
if (i == 1)
{
s.Checked = true;
StreamReader sr = new StreamReader(this.CurrentFolder + Path.DirectorySeparatorChar + "Scripts" + Path.DirectorySeparatorChar + file);
editorText.Text = sr.ReadToEnd();
sr.Close();
}
loadedScripts.DropDownItems.AddRange(new ToolStripItem[] {
s
});
i++;
}
}
mainMenu.Items.Add(scriptMenu);
mainMenu.Items.Add(loadedScripts);
//System.Diagnostics.Debug.WriteLine("script items:" + loadedScripts.DropDownItems.Count);
});
}