本文整理汇总了C#中System.Windows.Forms.ToolStripButton.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripButton.Select方法的具体用法?C# ToolStripButton.Select怎么用?C# ToolStripButton.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripButton
的用法示例。
在下文中一共展示了ToolStripButton.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRenderSplitButtonBackground
protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e)
{
ToolStripSplitButton item = (ToolStripSplitButton) e.Item;
if ((e.Item.Selected || item.ButtonPressed) || item.DropDownButtonPressed)
{
if (!item.DropDownButtonPressed)
{
Rectangle dropDownButtonBounds = item.DropDownButtonBounds;
dropDownButtonBounds = new Rectangle(dropDownButtonBounds.Left + 1, dropDownButtonBounds.Top + 5, dropDownButtonBounds.Width - 3, dropDownButtonBounds.Height - 10);
using (Region region = new Region(new Rectangle(Point.Empty, e.Item.Size)))
{
region.Xor(dropDownButtonBounds);
e.Graphics.SetClip(region, CombineMode.Replace);
base.OnRenderSplitButtonBackground(e);
e.Graphics.SetClip(dropDownButtonBounds);
e.Graphics.TranslateTransform((float) item.DropDownButtonBounds.Width, 0f);
if (item.ButtonPressed && (base.BaseRenderer is ToolStripProfessionalRenderer))
{
using (ToolStripButton button2 = new ToolStripButton())
{
button2.Select();
button2.Size = e.Item.Size;
base.OnRenderButtonBackground(new ToolStripItemRenderEventArgs(e.Graphics, button2));
}
}
else
{
base.OnRenderSplitButtonBackground(e);
}
e.Graphics.ResetTransform();
e.Graphics.ResetClip();
}
}
else
{
base.OnRenderSplitButtonBackground(e);
}
}
if (!item.DropDownButtonPressed)
{
this.OnRenderArrow(new ToolStripArrowRenderEventArgs(e.Graphics, e.Item, item.DropDownButtonBounds, Color.Black, ArrowDirection.Right));
}
}