DeselectTab() public method

public DeselectTab ( TabPage tabPage ) : void
tabPage TabPage
return void
Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
		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");		
		}