本文整理汇总了C#中System.Windows.Forms.TabControl.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# TabControl.Invoke方法的具体用法?C# TabControl.Invoke怎么用?C# TabControl.Invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TabControl
的用法示例。
在下文中一共展示了TabControl.Invoke方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PluginTabPage
internal PluginTabPage(string Title, Plugin Owner, TabControl Parent)
: base(Title)
{
this.Owner = Owner.PluginGuid;
Parent.ImageList.Images.Add(Owner.PluginGuid.ToString(), Owner.Icon);
ImageIndex = Parent.ImageList.Images.IndexOfKey(Owner.PluginGuid.ToString());
Parent.Invoke((MethodInvoker)(() => Globals.EditorTabs.TabPages.Add(this)));
}
示例2: SetTabControl
private static void SetTabControl(int pagina, TabControl tabAdmin)
{
tabAdmin.Invoke((MethodInvoker)delegate
{
tabAdmin.SelectedIndex = pagina;
});
}
示例3: GetSelectedTabName
/// <summary>
/// Get the name of the selected tab in a TabControl
/// </summary>
/// <param name="container">The tab container</param>
/// <param name="tabPages">The tab pages</param>
/// <returns>The name of the selected tab</returns>
public static string GetSelectedTabName(TabControl container, TabControl.TabPageCollection tabPages)
{
if (container.InvokeRequired)
{
GetSelectedTabNameCallback d = GetSelectedTabName;
try
{
return container.Invoke(d, new object[] { container, tabPages }) as string;
}
catch (Exception) { }
}
else
{
return tabPages[container.SelectedIndex].Name;
}
return string.Empty;
}
示例4: insertTab
public static void insertTab(TabControl tab, TabPage page, int index)
{
if (tab.InvokeRequired)
tab.Invoke(new inttabHandler(tab.TabPages.Insert), index, page);
else tab.TabPages.Insert(index, page);
}
示例5: addTab
public static void addTab(TabControl tab, TabPage page)
{
if (tab.InvokeRequired)
tab.Invoke(new tabHandler(tab.Controls.Add), page);
else tab.Controls.Add(page);
}
示例6: selectPage
public static void selectPage(TabControl tab, TabPage page)
{
if (tab.InvokeRequired)
tab.Invoke((tabHandler)delegate(TabPage p)
{ tab.SelectedTab = p; }, page);
else tab.SelectedTab = page;
}
示例7: removeTab
public static void removeTab(TabControl tab, int index)
{
if (tab.InvokeRequired)
tab.Invoke(new voidintHandler(tab.Controls.RemoveAt), index);
else tab.Controls.RemoveAt(index);
}
示例8: setTabEnable
private void setTabEnable(TabControl box, bool state)
{
box.Invoke(new setTabEnableDelegate(setTabEnableHelper), new object[] { box, state });
}