本文整理汇总了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);
}
}
示例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;
}
}
示例3: OnMenuClicked
void OnMenuClicked(object sender, ToolStripItemClickedEventArgs args)
{
foreach (var i in _guiElements) {
if (i.MenuTitle == args.ClickedItem.Text)
i.Form.Show();
}
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
}
}
示例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();
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例12: ToolStrip1ItemClicked
protected void ToolStrip1ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (ToolBarClick != null)
{
ToolBarClick(sender, e);
}
}
示例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);
}
}
示例14: ItemsListContextMenuItemClicked
private void ItemsListContextMenuItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem.Text == @"Copy value")
{
var selectedValue = _itemsListView.SelectedItems[0].Text;
Clipboard.SetText(selectedValue);
}
}
示例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();
}