当前位置: 首页>>代码示例>>C#>>正文


C# Forms.ToolStripItemClickedEventArgs类代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStripItemClickedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ToolStripItemClickedEventArgs类的具体用法?C# ToolStripItemClickedEventArgs怎么用?C# ToolStripItemClickedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ToolStripItemClickedEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripItemClickedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: contextMenuStrip1_ItemClicked

 private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     try
     {
         if (e.ClickedItem == mnuAdd)
         {
             this.AddMachine();
         }
         if (e.ClickedItem == mnuDelete)
         {
             if (dataGridView1.SelectedRows[0] != null)
             {
                 ContextMenuStrip context = sender as ContextMenuStrip;
                 context.Close();
                 this.DeleteMachine(dataGridView1.SelectedRows[0]);
             }
         }
         if (e.ClickedItem == mnuEdit)
         {
             if (dataGridView1.SelectedRows != null && dataGridView1.SelectedRows.Count > 0)
             {
                 this.EditMachine(dataGridView1.SelectedRows[0]);
             }
         }
     }
     catch(Exception ex)
     {
         Log.LogError("contextMenuStrip1_ItemClicked", ex);
     }
 }
开发者ID:PosauneMaster,项目名称:RecipeMaster_v3,代码行数:30,代码来源:SettingsForm.cs

示例2: CotxMenu_ItemClicked

        private void CotxMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            switch (e.ClickedItem.ToString())
            {
                case "Editar":
                    lblTitulo.Text = "Editar Cliente";
                    txtNombre.Text = grid.Rows[currentMouseOverRow].Cells[1].Value.ToString();
                    txtAp.Text = grid.Rows[currentMouseOverRow].Cells[2].Value.ToString();
                    txtAm.Text = grid.Rows[currentMouseOverRow].Cells[3].Value.ToString();
                    txtCalle.Text = grid.Rows[currentMouseOverRow].Cells[4].Value.ToString();
                    txtColonia.Text = grid.Rows[currentMouseOverRow].Cells[6].Value.ToString();
                    txtNumero.Text = grid.Rows[currentMouseOverRow].Cells[5].Value.ToString();
                    txtCP.Text = grid.Rows[currentMouseOverRow].Cells[7].Value.ToString();
                    txtRFC.Text = grid.Rows[currentMouseOverRow].Cells[14].Value.ToString();
                    string fecha = grid.Rows[currentMouseOverRow].Cells[9].Value.ToString();

                    DateTime dt = DateTime.Parse(fecha);
                    DateFechaNacimiento.Value = dt;
                    if (grid.Rows[currentMouseOverRow].Cells[11].Value.ToString() == "M")
                        radHombre.Checked = true;
                    else
                        radMujer.Checked = true;

                    Dialogo("Editar Producto");
                    break;
                case "Eliminar":
                    //manda un mensaje de si esta seguro (solo es logico)
                    break;
            }
        }
开发者ID:rigo9412,项目名称:Proyecto-T.B.D.,代码行数:30,代码来源:FormClientes.cs

示例3: OnMenuClicked

 void OnMenuClicked(object sender, ToolStripItemClickedEventArgs args)
 {
     foreach (var i in _guiElements) {
         if (i.MenuTitle == args.ClickedItem.Text)
             i.Form.Show();
     }
 }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:7,代码来源:MCForgeGuiManager.cs

示例4: ctxColumns_ItemClicked

		void ctxColumns_ItemClicked(object sender, ToolStripItemClickedEventArgs e)	{
			// F4.CheckOnClick=False because mni stays unchecked after I just checked
			ToolStripMenuItem mni = e.ClickedItem as ToolStripMenuItem;
			if (mni == null) {
				string msg = "You clicked on something not being a ToolStripMenuItem";
				Assembler.PopupException(msg);
				return;
			}
			mni.Checked = !mni.Checked;
			if (columnsByFilters.ContainsKey(mni) == false) {
				string msg = "Add ToolStripMenuItem[" + mni.Name + "] into columnsByFilters";
				Assembler.PopupException(msg);
				return;
			}
			bool newCheckedState = mni.Checked;
			// F4.CheckOnClick=true mni.Checked = newState;
//			this.settingsManager.Set("ExecutionForm." + mni.Name + ".Checked", mni.Checked);
//			this.settingsManager.SaveSettings();

			List<OLVColumn> columns = columnsByFilters[mni];
			if (columns.Count == 0) return;

			foreach (OLVColumn column in columns) {
				column.IsVisible = newCheckedState;
			}
			this.OrdersTree.RebuildColumns();
		}
开发者ID:sanyaade-fintechnology,项目名称:SquareOne,代码行数:27,代码来源:ExecutionTreeControl.EventConsumer.cs

示例5: dropDownButton_DropDownItemClicked

        private void dropDownButton_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            var curItem = e.ClickedItem as ToolStripMenuItem;

            if (curItem == null || !curItem.Checked)
                return;

            foreach (var toolStripItem in Items)
            {
                var buttonItem = toolStripItem as ToolStripButton;

                if (buttonItem != null && buttonItem.Checked)
                    buttonItem.Checked = false;

                var dropDownButton = toolStripItem as ToolStripDropDownButton;

                if (dropDownButton != null && dropDownButton != curItem.OwnerItem)
                {
                    foreach (ToolStripMenuItem item in dropDownButton.DropDownItems)
                        item.Checked = false;
                }
            }

            Invalidate();
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:25,代码来源:NavigationToolStrip.cs

示例6: MenuItemClicked

        private void MenuItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem;

            if (menuItem == null)
                return;

            switch (menuItem.Text)
            {
                case EXPORT_TO_EXCEL:
                    ToExcel();
                    break;

                case EXPORT_TO_CSV:
                    ToCsv();
                    break;

                case SEARCH:
                    ShowSearch();
                    break;

                default:
                    if (!menuItem.Checked || Columns.GetColumnCount(DataGridViewElementStates.Visible) > 1)
                    {
                        DataGridViewColumn column = (DataGridViewColumn)menuItem.Tag;
                        column.Visible            = !menuItem.Checked;
                        menuItem.Checked          = column.Visible;
                    }
                    break;
            }
        }
开发者ID:atan888,项目名称:MMS,代码行数:31,代码来源:ExtendedDataGridView.ContextMenu.cs

示例7: AttachmentToolStrip_ItemClicked

        private void AttachmentToolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Tag == null)
                return;
            else if(e.ClickedItem.Tag.ToString() == "Add")
            {
                OpenFileDialog dialog = new OpenFileDialog();

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    ListViewItem item = new ListViewItem(Path.GetFileName(dialog.FileName) + " (" + ((double)(new FileInfo(dialog.FileName).Length / 1000)).ToString("f2") + " KB)");
                    item.ImageIndex = 0;
                    item.Tag = dialog.FileName;
                    this.attachments.Add(dialog.FileName);
                    this.Attachments.Items.Add(item);
                }
            }
            else if (e.ClickedItem.Tag.ToString() == "Delete")
            {
                if (this.Attachments.SelectedItems.Count > 0)
                {
                    this.attachments.Remove(this.Attachments.SelectedItems[0].Tag.ToString());
                    this.Attachments.SelectedItems[0].Remove();
                }
            }
        }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:26,代码来源:EmailClient.cs

示例8: bindingNavigator1_ItemClicked

 private void bindingNavigator1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem.Text == "关闭")
     {
         this.Close();
     }
     if (e.ClickedItem.Text == "上一页")
     {
         pageCurrent--;
         if (pageCurrent <= 0)
         {
             MessageBox.Show("已经是第一页,请点击“下一页”查看!");
             return;
         }
         else
         {
             nCurrent = pageSize * (pageCurrent - 1);
         }
         LoadData();
     }
     if (e.ClickedItem.Text == "下一页")
     {
         pageCurrent++;
         if (pageCurrent > pageCount)
         {
             MessageBox.Show("已经是最后一页,请点击“上一页”查看!");
             return;
         }
         else
         {
             nCurrent = pageSize * (pageCurrent - 1);
         }
         LoadData();
     }
 }
开发者ID:xfgxfg,项目名称:CropWatchField,代码行数:35,代码来源:AggregateToVillageForm.cs

示例9: editMenu_Clicked

 private void editMenu_Clicked(object sender, ToolStripItemClickedEventArgs e)
 {
     //srcGrid.SelectedColumns[0].Index
     source = srcGrid.SelectedCells[0];
     srcTab = cTab.SelectedIndex;
     cTab.SelectedIndex = destTab;
 }
开发者ID:micmax93,项目名称:AL_KAIDA_TRAVELS,代码行数:7,代码来源:TableJump.cs

示例10: FileToolBar_ItemClicked

 void FileToolBar_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem == tOpenDocument) Global.MainForm.Open();
     else if (e.ClickedItem == tSaveFile) Global.MainForm.DoSave();
     else if (e.ClickedItem == tSaveAll) Global.MainForm.DoSaveAll();
     else if (e.ClickedItem == tPrint) Global.MainForm.DoPrint();
     else if (e.ClickedItem == tPrintPreview) Global.MainForm.DoPrintPreview();
 }
开发者ID:NikolayIT,项目名称:NStudio,代码行数:8,代码来源:FileToolBar.cs

示例11: globalScriptsToolStripMenuItem_DropDownItemClicked

 private void globalScriptsToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem.Tag != null)
     {
         var name = e.ClickedItem.Tag as string;
         PluginEngine.Default.ExecuteByName(name);
     }
 }
开发者ID:Emilgardis,项目名称:falloutsnip,代码行数:8,代码来源:MainView.Scripts.cs

示例12: ToolStrip1ItemClicked

 protected void ToolStrip1ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (ToolBarClick != null)
     {
         ToolBarClick(sender, e);
         
     }
 }
开发者ID:rehman922,项目名称:VIRETAIL,代码行数:8,代码来源:BaseToolBar.cs

示例13: lms_ItemClicked

 public void lms_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     try {
         Process.Start(Options.settings.Editor, Main.StartupPath + "/mariadb/data/" + e.ClickedItem.Text);
     } catch (Exception ex) {
         Log.wnmp_log_error(ex.Message, Log.LogSection.WNMP_MARIADB);
     }
 }
开发者ID:zjuyou,项目名称:wnmp,代码行数:8,代码来源:MariaDB.cs

示例14: ItemsListContextMenuItemClicked

		private void ItemsListContextMenuItemClicked(object sender, ToolStripItemClickedEventArgs e)
		{
			if (e.ClickedItem.Text == @"Copy value")
			{
				var selectedValue = _itemsListView.SelectedItems[0].Text;
				Clipboard.SetText(selectedValue);
			}
		}
开发者ID:martinjt,项目名称:elmah-loganalyzer,代码行数:8,代码来源:FilterSelector.cs

示例15: cMSTray_ItemClicked

 private void cMSTray_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem.Name == cMSTray_Start.Name)
         this.StartListenerThread();
     else if (e.ClickedItem.Name == cMSTray_Stop.Name)
         this.StopListenerThread();
     else if (e.ClickedItem.Name == cMSTray_Exit.Name)
         this.Close();
 }
开发者ID:henryford,项目名称:UDPLauncher_GUI,代码行数:9,代码来源:Main_Frm.cs


注:本文中的System.Windows.Forms.ToolStripItemClickedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。