當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ToolBarButtonClickEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolBarButtonClickEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ToolBarButtonClickEventArgs類的具體用法?C# ToolBarButtonClickEventArgs怎麽用?C# ToolBarButtonClickEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ToolBarButtonClickEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了ToolBarButtonClickEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: tBar_ButtonClick

 void tBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
 {
     OpenFileDialog f1;
     SaveFileDialog f2;
     switch (e.Button.ImageIndex)
     {
         case 0:
             
             f1 = new OpenFileDialog();
             if (f1.ShowDialog() == DialogResult.OK)
             {
                StreamReader r= File.OpenText(f1.FileName);
                textBox1.Text = r.ReadToEnd();
             }
             break;
         case 1:
             f2 = new SaveFileDialog();
             if (f2.ShowDialog() == DialogResult.OK)
             {
                 StreamWriter w = new StreamWriter(f2.FileName);
                 w.WriteLine(textBox1.Text);
                 w.Close();
             }
             break;
         case 2: Close(); break;
     }
 }
開發者ID:xs2ranjeet,項目名稱:13ns9-1spr,代碼行數:27,代碼來源:Form1.cs

示例2: ToolBar1_ButtonClick

        void ToolBar1_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
            if (e.Button == ToolBarButtonFilter) {
                entidadeList1.FilterVisible = ToolBarButtonFilter.Pushed;
                ToolBarButtonNew.Pushed = false;
                ToolBarButtonEdit.Pushed = false;
                entidadeList1.DisableEdit();
            } else {
                if (e.Button == ToolBarButtonNew) {
                    entidadeList1.AddEntidadeMovimento();
                } else if (e.Button == ToolBarButtonEdit) {
                    if (e.Button.Pushed) {
                        entidadeList1.EnableEdit();
                    } else {
                        entidadeList1.DisableEdit();
                    }
                } else if (e.Button == ToolBarButtonDelete) {
                    var selectedEntity = entidadeList1.SelectedItems[0].Tag as GISADataset.MovimentoEntidadeRow;
                    if (CanDeleteEntity(selectedEntity))
                        entidadeList1.DeleteSelectedEntidade();
                    else
                        MessageBox.Show("Só é permitido apagar entidades requerentes que ainda não estejam associadas a requisições/devoluções.", "Eliminação de entidades requerentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                Model.PersistencyHelper.save();
                Model.PersistencyHelper.cleanDeletedData();
            }

            UpdateEditGroup();
        }
開發者ID:aureliopires,項目名稱:gisa,代碼行數:28,代碼來源:FormMovimentos.cs

示例3: ProjectNewAction_ButtonClick

		private void ProjectNewAction_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
		{
			if (e.Button == _button)
			{
				DoAction();
			}
		}
開發者ID:ralescano,項目名稱:castle,代碼行數:7,代碼來源:ViewAvailableItemsAction.cs

示例4: toolBar_ButtonClick

        protected virtual void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            if (e.Button.Equals(tbOkButton))
                resultButton.DialogResult = DialogResult.OK;
            else resultButton.DialogResult = DialogResult.Cancel;

            resultButton.raiseclick();
        }
開發者ID:ntj,項目名稱:GravurGIS,代碼行數:8,代碼來源:IDialog.cs

示例5: OnClicked

        void OnClicked(object sender, ToolBarButtonClickEventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            if (dialog.ShowDialog(this) == DialogResult.OK) {
                selectedFolder = dialog.SelectedPath;
                statusbar.Text = selectedFolder;
            }
        }
開發者ID:SAUCS,項目名稱:CPTR-571-A,代碼行數:9,代碼來源:MainForm2.cs

示例6: Handle_ToolbarButtonClick

        private void Handle_ToolbarButtonClick( object pComponent, ToolBarButtonClickEventArgs e )
        {
            if( m_Dictionary.Contains( e.Button ))
            {
                MenuCommand pMenuItem = (MenuCommand) m_Dictionary[ e.Button ];

                if( pMenuItem != null )
                    pMenuItem.PerformClick( );
            }
        }
開發者ID:NeuroRoboticTech,項目名稱:AnimatLabVersion1,代碼行數:10,代碼來源:ButtonManager.cs

示例7: toolBar_ButtonClick

 private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
     string tag = (e.Button.Tag as string);
     if (tag == null)
         return;
     switch (tag.ToLower()) {
         case "clear":
             if (onClear != null)
                 onClear();
             break;
     }
 }
開發者ID:satr,項目名稱:regexexplorer,代碼行數:11,代碼來源:CheckClearToolBarControl.cs

示例8: OnButtonClick

        protected override void OnButtonClick(ToolBarButtonClickEventArgs e)
        {
            if (this.wholeDropDownButtons.Contains(e.Button))
            {
                // As the click event has fired for a whole dropdown we aren't
                // running under Windows, so show it ourselves
                this.ShowDropdownMenu(e.Button);
                return;
            }

            base.OnButtonClick(e);
        }
開發者ID:ribbons,項目名稱:RadioDownloader,代碼行數:12,代碼來源:ExtToolBar.cs

示例9: toolBar_ButtonClick

 void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
 {
     if (e.Button == backButton)
     {
         shellView.NavigateBack();
     }
     else if (e.Button == forwardButton)
     {
         shellView.NavigateForward();
     }
     else if (e.Button == upButton)
     {
         shellView.NavigateParent();
     }
 }
開發者ID:modulexcite,項目名稱:gong-shell,代碼行數:15,代碼來源:ExplorerForm.cs

示例10: toolBar_ButtonClick

 private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
     string tag = (e.Button.Tag as string);
     if (tag == null)
         return;
     switch (tag.ToLower()) {
         case "scaleup":
             if (onScaleUp != null)
                 onScaleUp();
             break;
         case "scaledown":
             if (onScaleDown != null)
                 onScaleDown();
             break;
     }
 }
開發者ID:satr,項目名稱:regexexplorer,代碼行數:15,代碼來源:ScalerToolBarControl.cs

示例11: MainToolBar_ButtonClick

		private void MainToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
		{
			if (e.Button == toolBarButton1)
			{
				using(DatabaseConnectionDialog dialog = new DatabaseConnectionDialog())
				{
					DialogResult result = dialog.ShowDialog(Workspace.ActiveWindow);

					if (result == DialogResult.OK)
					{
						IDatabaseDefinitionBuilder defBuilder = 
							ServiceRegistry.Instance[ typeof(IDatabaseDefinitionBuilder) ] as IDatabaseDefinitionBuilder;

						DatabaseDefinition def = defBuilder.Build(dialog.Alias, dialog.ConnectionString);

						Model.CurrentProject.AddDatabaseDefinition(def);

						Model.Update();
					}
				}
			}
		}
開發者ID:atczyc,項目名稱:castle,代碼行數:22,代碼來源:AddDatabaseAction.cs

示例12: controlBbar_ButtonClick

        void controlBbar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            if (e.Button == _mainForm.TbbtnBack)
            {
                //_browser.Navigate(new Uri("http://georize.de:9494/demo/index.html"));
                _browser.Navigate(new Uri("http://demo.krypsis.org/demo/index.html"));
            }
            else if (e.Button == _mainForm.TbbtnForward)
            {
                string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
                CfgFile cfg = new CfgFile(path + "\\confini.ci");
                string id = cfg.getValue("DATA", "uniqueid", true);
                if (id == "") {
                    MessageBox.Show("---");
                    SecurityProvider sp = new SecurityProvider();
                    id = sp.GetUniqueIDWithTimestamp(32);
                    cfg.setValue("DATA", "uniqueid", id ,true);
                    cfg.Save();
                }
                MessageBox.Show(id);
            }
            else if (e.Button == _mainForm.TbbtnNew)
            {

            }
            else if (e.Button == _mainForm.TbbtnSearch)
            {

            }
            else if (e.Button == _mainForm.TbbtnShow)
            {

            }
            else if (e.Button == _mainForm.TbbtnFavorites)
            {
                MessageBox.Show(DeviceInfo.GetSystemCountry()+"   "+DeviceInfo.GetSysstemLanguage());
            }
        }
開發者ID:ssoller,項目名稱:Krypsis,代碼行數:38,代碼來源:MainController.cs

示例13: toolBarBrushType_ButtonClick

        private void toolBarBrushType_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            // 設置Button按下狀態
            foreach (ToolBarButton button in toolBarBrushType.Buttons)
            {
                button.Pushed = (button == e.Button);
            }

            // 檢測按鈕按下狀態,處理之
            if (toolBarButtonPull.Pushed)
            {
                mEditTerrainHelper.DeformBrushType = 1;
            }
            else if (toolBarButtonSmooth.Pushed)
            {
                mEditTerrainHelper.DeformBrushType = 2;
            }
            else if (toolBarButtonNoise.Pushed)
            {
                mEditTerrainHelper.DeformBrushType = 3;
            }
            else if (toolBarButtonAverage.Pushed)
            {
                mEditTerrainHelper.DeformBrushType = 4;
            }
            else if (toolBarButtonFlat.Pushed)
            {
                mEditTerrainHelper.DeformBrushType = 5;
            }

            // 更新UI Panel
            trackerBarWidgetOutterRadius.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushOutterRadius);
            trackerBarWidgetInnerRadius.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushInnerRadius);
            trackerBarWidgetBrushPower.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushHardness);
            trackerBarWidgetHeight.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushHeight);
        }
開發者ID:arundev,項目名稱:dev-code,代碼行數:36,代碼來源:TerrainDeformPanel.cs

示例14: ToolBar_ButtonClick

        void ToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
            foreach (NodeTypeEntry nte in m_NodeTypes)
                if (nte.Button == e.Button) {
                    var center = new Point();
                    var random = new Random(1);

                    var rect1 = gViewer.ClientRectangle; //gViewer.Graph.GeometryGraph.BoundingBox;
                    var rect2 = gViewer.Graph.BoundingBox;
                    Point p = gViewer.ScreenToSource(rect1.Location);
                    Point p2 = gViewer.ScreenToSource(rect1.Location + rect1.Size);
                    if (p.X < rect2.Left)
                        p.X = rect2.Left;
                    if (p2.X > rect2.Right)
                        p2.X = rect2.Right;
                    if (p.Y > rect2.Top)
                        p.Y = rect2.Top;
                    if (p2.Y < rect2.Bottom)
                        p2.Y = rect2.Bottom;
                    var rect = new Microsoft.Msagl.Core.Geometry.Rectangle(p, p2);

                    center.X = rect.Left + random.NextDouble()*rect.Width;
                    center.Y = rect.Bottom + random.NextDouble()*rect.Height;

                    
                }
        }
開發者ID:filipparacka,項目名稱:Diplomovka,代碼行數:26,代碼來源:GraphEditor.cs

示例15: chartToolBar_ButtonClick

 private void chartToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
 {
     if (e.Button == this.btnZoomIn)
         this.ZoomIn();
     if (e.Button == this.btnZoomOut)
         this.ZoomOut();
     if (e.Button == this.btnCrosshair)
         this.Crosshair();
     if (e.Button == this.btnCursor)
         this.Pointer();
     if (e.Button == this.btnLinear)
         this.Linear();
     if (e.Button == this.btnLog)
         this.Log();
     if (e.Button == this.btnCandle)
         this.Candle();
     if (e.Button == this.btnBar)
         this.Bar();
     if (e.Button == this.btnLine)
         this.Line();
     if (e.Button == this.btnWholeRange)
         this.WholeRange();
     if (e.Button == this.btnTrailing)
         this.Trailing();
     if (e.Button == this.btnFixed)
         this.Fixed();
     if (e.Button != this.btnPnF)
         return;
     this.PnF();
 }
開發者ID:28427328,項目名稱:SQCharts,代碼行數:30,代碼來源:ToolBar.cs


注:本文中的System.Windows.Forms.ToolBarButtonClickEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。