本文整理汇总了C#中System.Windows.Forms.TabControl.DeselectTab方法的典型用法代码示例。如果您正苦于以下问题:C# TabControl.DeselectTab方法的具体用法?C# TabControl.DeselectTab怎么用?C# TabControl.DeselectTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TabControl
的用法示例。
在下文中一共展示了TabControl.DeselectTab方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ux_tabcontrolCreateNewTab
public void ux_tabcontrolCreateNewTab(TabControl ux_tabcontrolDataview, int indexOfNewTab)
{
DataviewProperties dvp = new DataviewProperties();
dvp.TabName = "";
dvp.DataviewName = "";
dvp.StrongFormName = "";
dvp.ViewerStyle = "Spreadsheet";
dvp.AlwaysOnTop = "false";
DataviewTabProperties newTabDialog = new DataviewTabProperties(_webServices, dvp);
newTabDialog.StartPosition = FormStartPosition.CenterParent;
if (newTabDialog.ShowDialog() == DialogResult.OK)
{
ux_tabcontrolAddTab(ux_tabcontrolDataview, newTabDialog.TabProperties.TabName, newTabDialog.TabProperties, indexOfNewTab);
ux_tabcontrolDataview.SelectedIndex = indexOfNewTab;
//SetDGVMainDataviewUserSettings();
}
else
{
ux_tabcontrolDataview.DeselectTab(indexOfNewTab);
}
}
示例2: MethodSelectTab
public void MethodSelectTab ()
{
TabControl tc = new TabControl ();
tc.TabPages.Add ("One", "One");
tc.TabPages.Add ("Two", "Two");
tc.TabPages.Add ("Three", "Three");
tc.SelectTab (1);
Assert.AreEqual (1, tc.SelectedIndex, "A1");
tc.SelectTab (tc.TabPages[2]);
Assert.AreEqual (2, tc.SelectedIndex, "A2");
tc.SelectTab ("One");
Assert.AreEqual (0, tc.SelectedIndex, "A3");
tc.SelectTab (1);
tc.DeselectTab (1);
Assert.AreEqual (2, tc.SelectedIndex, "A4");
tc.DeselectTab (2);
Assert.AreEqual (0, tc.SelectedIndex, "A5");
tc.DeselectTab (tc.TabPages[0]);
Assert.AreEqual (1, tc.SelectedIndex, "A6");
tc.DeselectTab (tc.TabPages[0]);
Assert.AreEqual (1, tc.SelectedIndex, "A7");
tc.DeselectTab (tc.TabPages[1]);
Assert.AreEqual (2, tc.SelectedIndex, "A7");
tc.DeselectTab ("Two");
Assert.AreEqual (2, tc.SelectedIndex, "A8");
tc.DeselectTab ("Three");
Assert.AreEqual (0, tc.SelectedIndex, "A8");
}