本文整理汇总了C#中System.Windows.Forms.ToolStripArrowRenderEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripArrowRenderEventArgs类的具体用法?C# ToolStripArrowRenderEventArgs怎么用?C# ToolStripArrowRenderEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripArrowRenderEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripArrowRenderEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRenderArrow
/// <summary>
/// Raises the <see cref="System.Windows.Forms.ToolStripRenderer.RenderArrow"/> event.
/// </summary>
/// <param name="e">A <see cref="System.Windows.Forms.ToolStripArrowRenderEventArgs"/> that contains the event data.</param>
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if (ColorTable.UseSystemColors == true)
{
base.OnRenderArrow(e);
}
else
{
ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable;
if ((colorTable != null) && (e.Item.Enabled == true))
{
if (e.Item.Owner is MenuStrip)
{
e.ArrowColor = colorTable.MenuItemText;
}
else if (e.Item.Owner is StatusStrip)
{
e.ArrowColor = colorTable.StatusStripText;
}
else
{
if (e.Item.Owner.GetType() != typeof(ToolStripDropDownMenu))
{
e.ArrowColor = colorTable.ToolStripText;
}
}
}
base.OnRenderArrow(e);
}
}
示例2: OnRenderArrow
/// <summary>
/// Raises the RenderArrow event.
/// </summary>
/// <param name="e">A ToolStripArrowRenderEventArgs that contains the event data.</param>
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if (ColorTable.UseSystemColors == false)
{
ProfessionalColorTable colorTable = ColorTable as XiaoCai.WinformUI.Panels.ProfessionalColorTable;
if (colorTable != null)
{
if ((e.Item.Owner.GetType() == typeof(MenuStrip)) && (e.Item.Selected == false) && e.Item.Pressed == false)
{
if (colorTable.MenuItemText != Color.Empty)
{
e.ArrowColor = colorTable.MenuItemText;
}
}
if ((e.Item.Owner.GetType() == typeof(StatusStrip)) && (e.Item.Selected == false) && e.Item.Pressed == false)
{
if (colorTable.StatusStripText != Color.Empty)
{
e.ArrowColor = colorTable.StatusStripText;
}
}
}
}
base.OnRenderArrow(e);
}
示例3: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if (currentRenderer != null)
currentRenderer.DrawArrow(e);
else
base.OnRenderArrow(e);
}
示例4: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if (e.Item.Enabled)
{
e.ArrowColor = FORE_COLOR;
}
base.OnRenderArrow(e);
}
示例5: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if(e.Item.Enabled)
e.ArrowColor = Color.Black;
else
e.ArrowColor = SystemColors.GrayText;
base.OnRenderArrow(e);
}
示例6: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
ToolStripDropDownItem item = e.Item as ToolStripDropDownItem;
if (!(((item == null) || (e.Direction != ArrowDirection.Down)) || item.DropDown.Visible))
{
e.Direction = ArrowDirection.Right;
}
base.OnRenderArrow(e);
}
示例7: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
if (!e.Item.Selected && !e.Item.Pressed)
{
e.ArrowColor = ColorScheme.ColorGray89;
}
base.OnRenderArrow(e);
}
示例8: OnRenderArrow
/// <summary>
/// 绘制 ToolStripItem 上的箭头。
/// </summary>
/// <param name="e"></param>
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
Graphics g = e.Graphics;
Image arrow = AssemblyHelper.GetImage("QQ.ContextMenu.menu_arrow.png");
Rectangle imgPoint = new Rectangle(
e.ArrowRectangle.X + 4,
(e.ArrowRectangle.Height - arrow.Height) / 2,
arrow.Width,
arrow.Height);//图片的位置和显示的大小
Rectangle imgRect = new Rectangle(0, 0, arrow.Width, arrow.Height);
g.DrawImage(arrow, imgPoint, imgRect, GraphicsUnit.Pixel);
}
示例9: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
ToolStripSplitButton item = e.Item as ToolStripSplitButton;
if (!((e.Item is ToolStripMenuItem) || !((item != null) ? item.ButtonPressed : e.Item.Pressed)))
{
Rectangle arrowRectangle = e.ArrowRectangle;
arrowRectangle.Offset(1, 1);
e.ArrowRectangle = arrowRectangle;
}
if (!e.Item.Enabled)
{
e.ArrowColor = SystemColors.GrayText;
}
base.OnRenderArrow(e);
}
示例10: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
try
{
e.ArrowRectangle = Rectangle.Inflate(e.ArrowRectangle, 5, -2);
if (e.Direction == ArrowDirection.Down)
e.Graphics.DrawImageUnscaled(Properties.Resources.bullet_arrow_down, e.ArrowRectangle);
else if (e.Direction == ArrowDirection.Up)
e.Graphics.DrawImageUnscaled(Properties.Resources.bullet_arrow_up, e.ArrowRectangle);
else if (e.Direction == ArrowDirection.Left)
e.Graphics.DrawImageUnscaled(Properties.Resources.bullet_arrow_left, e.ArrowRectangle);
else if (e.Direction == ArrowDirection.Right)
e.Graphics.DrawImageUnscaled(Properties.Resources.bullet_arrow_right, e.ArrowRectangle);
//e.Graphics.FillRectangle(Brushes.Red, e.ArrowRectangle);
}
catch
{
base.OnRenderArrow(e);
}
}
示例11: OnRenderArrow
/// <summary>
/// Raises the RenderArrow event.
/// </summary>
/// <param name="e"> An ToolStripArrowRenderEventArgs containing the event data. </param>
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
// Cannot paint a zero sized area
if ((e.ArrowRectangle.Width > 0) &&
(e.ArrowRectangle.Height > 0))
{
// Create a path that is used to fill the arrow
using (GraphicsPath arrowPath = this.CreateArrowPath(e.Item,
e.ArrowRectangle,
e.Direction))
{
// Get the rectangle that encloses the arrow and expand slightly
// so that the gradient is always within the expanding bounds
RectangleF boundsF = arrowPath.GetBounds();
boundsF.Inflate(1f, 1f);
Color color1 = (e.Item.Enabled ? _arrowLight : _arrowDisabled);
Color color2 = (e.Item.Enabled ? _arrowDark : _arrowDisabled);
float angle = 0;
// Use gradient angle to match the arrow direction
switch (e.Direction)
{
case ArrowDirection.Right:
angle = 0;
break;
case ArrowDirection.Left:
angle = 180f;
break;
case ArrowDirection.Down:
angle = 90f;
break;
case ArrowDirection.Up:
angle = 270f;
break;
}
// Draw the actual arrow using a gradient
using (LinearGradientBrush arrowBrush = new LinearGradientBrush(boundsF, color1, color2, angle))
e.Graphics.FillPath(arrowBrush, arrowPath);
}
}
}
示例12: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
e.Direction = ArrowDirection.Right;
base.OnRenderArrow(e);
}
示例13: OnRenderArrow
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
using (var bmp = Bitmaps.Load("Arrow"))
e.Graphics.DrawImage(bmp, new Point(e.Item.Bounds.Width - 10, e.ArrowRectangle.Y + 7));
}
示例14: DrawArrow
/// <include file='doc\WinBarRenderer.uex' path='docs/doc[@for="ToolStripRenderer.DrawArrow"]/*' />
public void DrawArrow(ToolStripArrowRenderEventArgs e) {
OnRenderArrow(e);
ToolStripArrowRenderEventHandler eh = Events[EventRenderArrow] as ToolStripArrowRenderEventHandler;
if (eh != null) {
eh(this, e);
}
}
示例15: OnRenderArrow
/// <summary>Override - see base.</summary>
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
// The default renderer will draw an arrow for us (the UXTheme API seems not to have one for all directions),
// but it will get the colour wrong in many cases. The text colour is probably the best colour to use.
if (EnsureRenderer())
e.ArrowColor = GetItemTextColor(e.Item);
base.OnRenderArrow(e);
}