示例#1
0
        private void tabs_Selecting(object sender, TabControlCancelEventArgs e)
        {
            string username = txtUsername.Text.Trim();
            string api_key = txtAPIKey.Text.Trim();

            if (e.TabPageIndex != 0)
            {
                if (username.Length == 0 || api_key.Length == 0)
                {
                    MessageBox.Show("Please enter your DataSift username and API key.", "Error");
                    e.Cancel = true;
                    return;
                }
            }

            if (m_user == null || m_user.getUsername() != username || m_user.getApiKey() != api_key)
            {
                m_user = null;
                m_user = new User(username, api_key);
            }

            if (e.TabPage.Text.EndsWith("*"))
            {
                e.TabPage.Text = e.TabPage.Text.TrimEnd(new char[] { '*' });
            }
        }
 private void metroTabControl1_Deselecting(object sender, TabControlCancelEventArgs e)
 {
     if (this.authorizeTabChange() == false)
     {
         e.Cancel = true;
     }
 }
示例#3
0
 /// <summary>
 /// When the tab control is selecting the preview tab page, we must process
 /// the user input and display the processed text to the browser.
 /// </summary>
 private void TabControl_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPage == this.mTabPagePreview)
     {
         this.mHtmlPanel.Text = MarkdownHelper.TranslateWithStyle(this.mTextBoxUserInput.Text);
     }
 }
示例#4
0
        private void tcTabs_Deselecting(object sender, TabControlCancelEventArgs e)
        {
            if (tcTabs.SelectedTab == null)
                return;

            _tabMap[tcTabs.SelectedTab].OnControlInvisible();
        }
示例#5
0
 void frame_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPage != page)
     {
         DeactivateControl();
     }
 }
示例#6
0
 private void BaseTabs_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (BaseTabs.SelectedIndex != CurrentStep)
     {
         BaseTabs.SelectTab(CurrentStep);
         MessageBox.Show("Use the 'Next Step ->' and '<- Previous Step' buttons on the bottom right and left corners of this window for navigation.");
     }
 }
示例#7
0
 private void tcResponse_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPageIndex == 1 && !isOpened)
     {
         wbResponse.DocumentText = Response;
         isOpened = true;
     }
 }
示例#8
0
        private void tbPropiedades_Selecting(object sender, TabControlCancelEventArgs e)
        {
            if (bandera)
            {
                if (!cbReceta.Checked)
                {
                    e.Cancel = true;

                }
            }
        }
示例#9
0
 private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
 {
     DataTable dataTableSource = DataBasaManeger.GetTypeDateSet().Tables[e.TabPage.Text];
     adventureWorksLT2008DataSetBindingSource.DataSource = dataTableSource;
     bindingNavigator1.BindingSource = adventureWorksLT2008DataSetBindingSource;
     dataGridView1.DataSource = adventureWorksLT2008DataSetBindingSource;
     toolStripComboBox1.Items.Clear();
     foreach (DataColumn column in dataTableSource.Columns)
         toolStripComboBox1.Items.Add(column.ColumnName);
     toolStripComboBox1.SelectedIndex = 0;
 }
示例#10
0
 public void TabPageRemove(TabPage tp)
 {
     int i = SelectedTab == tp ? SelectedIndex == TabCount - 1 ? SelectedIndex - 1 : SelectedIndex : -1;
       if (TabPageRemoving != null)
       {
     TabControlCancelEventArgs tccea = new TabControlCancelEventArgs(tp, TabPages.IndexOf(tp), false, TabControlAction.Deselecting);
     TabPageRemoving(this, tccea);
     if (tccea.Cancel) return;
       }
       TabPages.Remove(tp);
       if (i >= 0) SelectedIndex = i;
 }
示例#11
0
        private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
        {
            buttonSaveChanges.DataBindings.Remove(buttonSaveChanges.DataBindings[0]);
            buttonCancelChanges.DataBindings.Remove(buttonCancelChanges.DataBindings[0]);
            buttonDoUndo.DataBindings.Remove(buttonDoUndo.DataBindings[0]);
            buttonDoRedo.DataBindings.Remove(buttonDoRedo.DataBindings[0]);

            DataDisplayControl displayControl = e.TabPage.Controls[0] as DataDisplayControl;

            buttonSaveChanges.DataBindings.Add("Enabled", displayControl.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);
            buttonCancelChanges.DataBindings.Add("Enabled", displayControl.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);
            buttonDoUndo.DataBindings.Add("Enabled", displayControl.Context.Commands, "CanBackward", false, DataSourceUpdateMode.Never);
            buttonDoRedo.DataBindings.Add("Enabled", displayControl.Context.Commands, "CanForward", false, DataSourceUpdateMode.Never);
        }
示例#12
0
        /// <summary>
        /// Closes the tab
        /// </summary>
        public void Close()
        {
            var parent = this.Parent as CustomTabControl;
            if (parent == null)
                return;

            int index;
            for (index = 0; index < parent.TabPages.Count; index++)
                if (parent.TabPages[index] == this)
                    break;

            var args = new TabControlCancelEventArgs(this, index, false, TabControlAction.Selected);
            this.Closing(parent, args);
            if (args.Cancel)
            {
                parent.TabPages.Remove(this);
                this.Dispose();
            }
        }
示例#13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public virtual void TabControl_Deselecting(object sender, TabControlCancelEventArgs e)
 {
     if (!FakUserInterface.EventTilt)
     {
         if (AktivControl != null)
         {
             if (AktivControl.Tabinfo != null && AktivControl.Userabortkerdes(AktivControl.Tabinfo))
                 e.Cancel = true;
             else if (AktivControl.Aktualtablainfo != null && AktivControl.Userabortkerdes())
                 e.Cancel = true;
             if (AktivControl.Name == "Mezonevek")
             {
                 if (AktivControl.Tabinfo.Tablanev == "VALTOZASNAPLO" || AktivControl.Tabinfo.Tablanev == "USERLOG")
                     AktivControl.Tabinfo.Adattabla.Rows.Clear();
             }
         }
         else if (!e.TabPage.Enabled)
             e.Cancel = true;
     }
 }
示例#14
0
        /// <summary>
        /// The close tab.
        /// </summary>
        /// <param name="index">
        /// The index.
        /// </param>
        private void CloseTab(int index)
        {
            // 	If we are clicking on a closer then remove the tab instead of raising the standard mouse click event. But raise the tab closing event first
            TabPage tab = this.TabPages[index];
            if (this.TabPageClosing != null)
            {
                var args = new TabControlCancelEventArgs(tab, index, false, TabControlAction.Deselecting);
                this.TabPageClosing(this, args);
                if (args.Cancel)
                {
                    return;
                }
            }

            this.TabPages.Remove(tab);
            tab.Dispose();
        }
示例#15
0
        /// <summary>
        /// The on deselecting.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnDeselecting(TabControlCancelEventArgs e)
        {
            var mouseLoc = this.PointToClient(MousePosition);
            var index = this.ActiveIndex;
            if (index != e.TabPageIndex)
            {
                if ((this.UseTabReloader && this.TabPageReloading != null && this.GetReloaderRect(index).Contains(mouseLoc))
                    || (this.UseTabCloser && this.GetCloserRect(index).Contains(mouseLoc)))
                {
                    e.Cancel = true;
                }
            }

            // Tab Closer should be handled at last since it may remove the tab!
            base.OnDeselecting(e);
        }
示例#16
0
 private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (tabControl1.Controls[0] == tabControl1.SelectedTab)
         saveDir = Properties.Settings.Default.trainer_folder + "/pc";
     else if (tabControl1.Controls[1] == tabControl1.SelectedTab)
         saveDir = Properties.Settings.Default.trainer_folder + "/ps3";
     else if(tabControl1.Controls[2] == tabControl1.SelectedTab)
         saveDir = Properties.Settings.Default.trainer_folder + "/xbox360";
     else if (tabControl1.Controls[3] == tabControl1.SelectedTab)
         saveDir = Properties.Settings.Default.trainer_folder + "/wiiu";
     label2.Visible = true;
     listView1.Cursor = Cursors.WaitCursor;
     listView2.Cursor = Cursors.WaitCursor;
     listView3.Cursor = Cursors.WaitCursor;
     listView4.Cursor = Cursors.WaitCursor;
     if (!backgroundWorker1.IsBusy)
         backgroundWorker1.RunWorkerAsync();
 }
示例#17
0
 private void tabControl_Selecting(object sender, TabControlCancelEventArgs e) {
     if (ChangingPage) ChangingPage = false;
     else e.Cancel = true;
 }
示例#18
0
 protected virtual void OnDeselecting(TabControlCancelEventArgs e)
 {
     throw null;
 }
 private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
 {
     switch (e.TabPageIndex)
     {
         case 0:
             if (!(comboBox1.Items.Count > 0))
             {
                 e.Cancel = true;
             }
             break;
         case 1:
             if (!(comboBox2.Items.Count > 0))
             {
                 e.Cancel = true;
             }
             break;
         case 2:
             if (!(comboBox3.Items.Count > 0))
             {
                 e.Cancel = true;
             }
             break;
         case 3:
             if (!(comboBox4.Items.Count > 0))
             {
                 e.Cancel = true;
             }
             break;
     }
 }
示例#20
0
 private void tabsChatChannels_Deselecting(object sender, TabControlCancelEventArgs e)
 {
     //this.LastTab = e.TabPage;
 }
示例#21
0
        void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
        {
            // Before selecting,
            // If there is a selected tab, take it's screenshot
            // invalidate the tab's thumbnail
            // update the "preview" object with the new thumbnail
            if (tabControl1.TabPages.Count > 0 && tabControl1.SelectedTab != null)
                UpdatePreviewBitmap(previousSelectedPage);

            // update our selected tab
            previousSelectedPage = tabControl1.SelectedTab;
        }
示例#22
0
 private void tbcHistoriaClinica_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPage.Enabled == false)
     {
         e.Cancel = true;
     }
 }
示例#23
0
 void StructEditor_Deselecting(object sender, System.Windows.Forms.TabControlCancelEventArgs e)
 {
     this.Commit();
 }
示例#24
0
 private void tabControl_Deselecting(dynamic sender, TabControlCancelEventArgs e)
 {
     toolStripStatusLabel1.Text = "Switching Tab";
     dynamic control = sender as TabControl;
     if (control != null)
     {
         int currentindex = sender.SelectedIndex;
         var current = tabControl.TabPages[currentindex];
         bool go_ahead = true;
         switch (current.Text)
         {
             case "Configuration":
                 go_ahead = ConfirmIfConfigChanged();
                 break;
             case "Clusters":
                 break;
             case "Node Assignment":
                 break;
         }
         if (!go_ahead) toolStripStatusLabel1.Text = "Switching Tab Cancelled";
         e.Cancel = !go_ahead;
     }
 }
示例#25
0
        //
        // Tab Control
        //
        private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
        {
            if (current == null)
            {
                e.Cancel = true;
                MessageBox.Show("Select a problem first");
                return;
            }

            if (e.TabPage == submissionTab)
            {
                LoadSubmission();
            }
            else if (tabControl1.SelectedTab == discussTab)
            {
                ShowDiscuss();
            }
            else if (tabControl1.SelectedTab == htmlTab)
            {
                problemWebBrowser.Navigate(LocalDirectory.GetProblemHtml(current.pnum));
            }
            else if (tabControl1.SelectedTab == pdfTab)
            {
                setPdfFile(LocalDirectory.GetProblemPdf(current.pnum));
            }
        }
示例#26
0
 private void tabControldanhmucnhacungcap_Selecting(object sender, TabControlCancelEventArgs e)
 {
     try
     {
         if (!e.TabPage.Enabled)
         {
             e.Cancel = true;
         }
     }
     catch { }
 }
示例#27
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles the Deselecting event of the m_tabControl control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.TabControlCancelEventArgs"/> instance containing the event data.</param>
		/// ------------------------------------------------------------------------------------
		private void m_tabControl_Deselecting(object sender, TabControlCancelEventArgs e)
		{
			StyleInfo info = null;
			StyleListItem item = m_styleListHelper.SelectedStyle;
			if (item != null)
				info = (StyleInfo)item.StyleInfo;
			// NOTE: tabDeselecting (e.TabPage) can be null after removing a tabpage from the tabControl
			// hopefully SaveToInfo got called for the tab page being removed.
			IStylesTab tabDeselecting = e.TabPage != null ? (IStylesTab)e.TabPage.Controls[0] : null;
			if (info != null && m_generalTab.StyleName != info.Name &&
				m_styleTable.ContainsKey(m_generalTab.StyleName))
			{
				// duplicate style name so don't change tab selection from General (TE-6092)
				Debug.Assert(tabDeselecting == null || tabDeselecting == m_tbGeneral.Controls[0]);
				e.Cancel = true;
				return;
			}
			// If we have an empty list, and hence no style, restrict the user to the General tab.
			// (See FWR-3305.)
			if (item == null && m_lstStyles.Items.Count == 0 && tabDeselecting == m_tbGeneral.Controls[0])
			{
				e.Cancel = true;
				return;
			}
			if (tabDeselecting != null)
			{
				if (m_fOkToSaveTabsToStyle && info != null)
					tabDeselecting.SaveToInfo(info);
				m_styleTable.ConnectStyles();
			}
		}
示例#28
0
 private void tabControl_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (!e.TabPage.Enabled)
     {
         e.Cancel = true;
         MessageBox.Show("กรุณาใส่ข้อมูลนำเข้าด้านล่าง", "Error");
     }
 }
示例#29
0
		private void m_tabControl_Selecting(object sender, TabControlCancelEventArgs e)
		{
			StyleInfo info = null;
			StyleListItem item = m_styleListHelper.SelectedStyle;
			if (item != null)
			{
				info = (StyleInfo)item.StyleInfo;
				Debug.Assert(info != null ||
							 (m_tabControl.SelectedTab == m_tbGeneral && item.IsDefaultParaCharsStyle),
					"StyleInfo should only be null for Default Paragraph Characters");
			}
			IStylesTab tab = (IStylesTab)m_tabControl.SelectedTab.Controls[0];
			tab.UpdateForStyle(info);
		}
示例#30
0
 private void tbcHistoriaClinicaPartes_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (numAccion == clsComun.INSERTAR)
     {
         if (e.TabPage.Enabled == false)
         {
             e.Cancel = true;
         }
     }
 }
示例#31
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Forms.TabControl.Deselecting" /> event.
 /// </summary>
 /// <param name="e">A <see cref="T:System.Windows.Forms.TabControlCancelEventArgs" /> that contains the event data.</param>
 protected override void OnDeselecting(System.Windows.Forms.TabControlCancelEventArgs e)
 {
     OldIndex = e.TabPageIndex;
 }
示例#32
0
 private void BaseTabs_Selecting(object sender, TabControlCancelEventArgs e)
 {
     switch (BaseTabs.SelectedTab.Name)
     {
         case ("Zero"):
             if (this.CurrentStep != 0) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
         case("One"):
             if (this.CurrentStep != 1) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
         case ("Two"):
             if (this.CurrentStep != 2) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
         case ("Three"):
             if (this.CurrentStep != 3) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
         case ("Four"):
             if (this.CurrentStep != 4) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
         case ("Five"):
             if (this.CurrentStep != 5) this.BaseTabs.SelectTab(this.CurrentStep);
             break;
     }
 }
 private void tbc_Info_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPage != null)
     {
         if (e.TabPage.Name == "tp_StaHead_Begin")      //起始分站
         {
             if (!blIsBegin)
             {
                 //tvc_BeginStaHead_Select.SelectedNode = tvc_BeginStaHead_Select.Nodes[0];
                 //tvc_BeginStaHead_Select.SetSelectNodeColor();
                 LoadTreeView_StaHead(tvc_BeginStaHead_Select, true);
                 strStaHead = "";
                 blIsBegin = true;
             }
         }
         else if (e.TabPage.Name == "tp_StaHead_End")   //终止分站
         {
             if (blIsBegin)
             {
                 //tvc_EndStaHead_Select.SelectedNode = tvc_EndStaHead_Select.Nodes[0];
                 //tvc_EndStaHead_Select.SetSelectNodeColor();
                 LoadTreeView_StaHead(tvc_EndStaHead_Select, true);
                 strStaHead = "";
                 blIsBegin = false;
             }
         }
     }
 }