本文整理汇总了C#中System.Windows.Forms.ToolStripItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripItemEventArgs类的具体用法?C# ToolStripItemEventArgs怎么用?C# ToolStripItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripItemEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: msMain_ItemAdded
private void msMain_ItemAdded(object sender, ToolStripItemEventArgs e)
{
if (e.Item.Text == "" || e.Item.Text == "还原(&R)" || e.Item.Text == "最小化(&N)" || e.Item.Text == "关闭(&C)")
{
msMain.Items.RemoveAt(e.Item.MergeIndex);
}
}
示例2: OnItemAdded
/// <summary>
/// OnItemAdded-Event we adjust the font and forecolor of this item
/// </summary>
/// <param name="e"></param>
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
e.Item.Font = MetroUI.Style.BaseFont;
e.Item.ForeColor = MetroUI.Style.ForeColor;
base.OnItemAdded(e);
}
示例3: menuTop_ItemAdded
/// <summary>顶部菜单-项添加事件</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuTop_ItemAdded(object sender, ToolStripItemEventArgs e)
{
if (e.Item.Text.Length == 0)
{
e.Item.Visible = false;
}
}
示例4: OnItemAdded
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
if (SecurityExclude(e.Item))
Items.Remove(e.Item);
else
base.OnItemAdded(e);
}
示例5: OnItemRemoved
private void OnItemRemoved(object sender, ToolStripItemEventArgs e)
{
if (e.Item != _item)
return;
RegisterEvents(register: false);
_lifetime.Dispose();
}
示例6: OnItemAdded
/// <summary>
/// When button is added, listen for it's hover events
/// </summary>
private void OnItemAdded(Object sender, ToolStripItemEventArgs e)
{
if (e.Item is ToolStripButton)
{
e.Item.MouseEnter += new EventHandler(this.OnOverChange);
e.Item.MouseLeave += new EventHandler(this.OnOverChange);
}
}
示例7: menuStrip1_ItemAdded
private void menuStrip1_ItemAdded(object sender, ToolStripItemEventArgs e)
{
if (e.Item.Text.Length == 0 || e.Item.Text == "还原(&R)" || e.Item.Text == "最小化(&N)"||e.Item.Text == "关闭(&C)")
{
e.Item.Visible = false;
}
}
示例8: m_obRight_ItemAdded
//�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡο����Ӧ����
void m_obRight_ItemAdded(object sender, ToolStripItemEventArgs e)
{
m_obContRight.Width = 900;
int width = Button_item_slot;
for (int i = 0; i < m_obRight.Items.Count; i++)
{
width += m_obRight.Items[i].Width;
}
m_obContRight.Width = width;
}
示例9: OnItemAdded
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
var button = e.Item as ToolStripButton;
if (button != null)
button.CheckedChanged += button_CheckedChanged;
var dropDownButton = e.Item as ToolStripDropDownButton;
if (dropDownButton != null)
dropDownButton.DropDownItemClicked += dropDownButton_DropDownItemClicked;
base.OnItemAdded(e);
}
示例10: ItemAdded
internal void ItemAdded(object sender, ToolStripItemEventArgs e)
{
if (e.Item is IActionNameContainer)
{
var anc = e.Item as IActionNameContainer;
if (anc.ActionName != ActionNames.None)
{
actionitems.Add(anc.ActionName.ToString(), e.Item as ToolStripItem);
var actionManager = Services.ServiceProvider.GetInstance().GetService<IActionManager>();
actionManager.Actions[anc.ActionName].EnabledChanged +=
new EventHandler(ActionEnabledChanged);
}
}
if (e.Item is ToolStripMenuItem)
{
var menuItem = (e.Item as ToolStripMenuItem);
menuItem.Click += new EventHandler(ItemClick);
foreach (System.Windows.Forms.ToolStripItem subitem in menuItem.DropDownItems)
{
ItemAdded(e.Item, new ToolStripItemEventArgs(subitem));
}
}
}
示例11: OnItemAdded
protected internal virtual void OnItemAdded(ToolStripItemEventArgs e)
{
this.DoLayoutIfHandleCreated(e);
if ((!this.HasVisibleItems && (e.Item != null)) && ((IArrangedElement) e.Item).ParticipatesInLayout)
{
this.HasVisibleItems = true;
}
ToolStripItemEventHandler handler = (ToolStripItemEventHandler) base.Events[EventItemAdded];
if (handler != null)
{
handler(this, e);
}
}
示例12: menuStrip_ItemAdded
private void menuStrip_ItemAdded(object sender, ToolStripItemEventArgs e)
{
// Translate the items in the menu by finding their Tags in the translation file.
foreach (ToolStripMenuItem objItem in menuStrip.Items.OfType<ToolStripMenuItem>())
{
if (objItem.Tag != null)
{
objItem.Text = LanguageManager.Instance.GetString(objItem.Tag.ToString());
}
}
}
示例13: toolStrip_ItemRemoved
private void toolStrip_ItemRemoved(object sender, ToolStripItemEventArgs e)
{
// ToolStrip Items.
foreach (ToolStrip objToolStrip in this.Controls.OfType<ToolStrip>())
{
foreach (ToolStripButton objButton in objToolStrip.Items.OfType<ToolStripButton>())
{
if (objButton.Tag != null)
objButton.Text = LanguageManager.Instance.GetString(objButton.Tag.ToString());
}
}
}
示例14: menuMain_ItemAdded
private void menuMain_ItemAdded(object sender, ToolStripItemEventArgs e)
{
if (e.Item.Text == "")
{
e.Item.Image = null;
}
}
示例15: OnItemAdded
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.ToolStrip.ItemAdded"/> event.
/// </summary>
/// <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemEventArgs"/> that contains the event data.</param>
protected override void OnItemAdded(ToolStripItemEventArgs e)
{
base.OnItemAdded(e);
if (ProgressBar == null)
{
ToolStripProgressBar pb = e.Item as ToolStripProgressBar;
if (pb != null)
{
ProgressBar = pb;
}
}
if (ProgressLabel == null)
{
ToolStripStatusLabel sl = e.Item as ToolStripStatusLabel;
if (sl != null)
{
ProgressLabel = sl;
}
}
}