本文整理汇总了C#中System.Windows.Forms.ToolStripSeparatorRenderEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripSeparatorRenderEventArgs类的具体用法?C# ToolStripSeparatorRenderEventArgs怎么用?C# ToolStripSeparatorRenderEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripSeparatorRenderEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripSeparatorRenderEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
// base.OnRenderSeparator(e);
if (!e.Item.IsOnDropDown)
{
int top = 9;
int left = e.Item.Width / 2; left--;
int height = e.Item.Height - top * 2;
RectangleF separator = new RectangleF(left, top, 0.5f, height);
using (LinearGradientBrush b = new LinearGradientBrush(
separator.Location,
new Point(Convert.ToInt32(separator.Left), Convert.ToInt32(separator.Bottom)),
Color.Red, Color.Black))
{
ColorBlend blend = new ColorBlend();
blend.Colors = new Color[] { ToolStripColorTable.ToolStripSplitButtonTop, ToolStripColorTable.ToolStripSplitButtonMiddle, ToolStripColorTable.ToolStripSplitButtonMiddle, ToolStripColorTable.ToolStripSplitButtonBottom };
blend.Positions = new float[] { 0.0f, 0.22f, 0.78f, 1.0f };
b.InterpolationColors = blend;
e.Graphics.FillRectangle(b, separator);
}
}
}
示例2: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Point pt1 = new Point(32, 3);
Point pt2 = new Point(e.Item.Width, 3);
e.Graphics.DrawLine(new Pen(separator), pt1, pt2);
base.OnRenderSeparator(e);
}
示例3: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Rectangle rect = e.Item.ContentRectangle;
using (Pen pen = new Pen(SEPARATOR_COLOR))
{
e.Graphics.DrawLine(pen, -1, rect.Y, rect.Right + 2, rect.Y);
}
}
示例4: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
int height = e.Item.Height;
int width = e.Item.Width;
e.Graphics.FillRectangle(SystemBrushes.Desktop, 0, 0, width, height);
e.Graphics.DrawLine(Pens.Gray, 4, height / 2, width - 4, height / 2);
}
示例5: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Rectangle rect = new Rectangle(32, 3, e.Item.Width - 32, 1);
Rectangle rect2 = new Rectangle(32, 4, e.Item.Width - 32, 1);
e.Graphics.FillRectangle(new SolidBrush(bgColor2), rect);
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x5f, itemColor)), rect2);
base.OnRenderSeparator(e);
}
示例6: OnRenderSeparator
/* --------------------------------------------------------------------- */
/// OnRenderSeparator
/* --------------------------------------------------------------------- */
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
//base.OnRenderSeparator(e);
var separator = e.Item as ToolStripSeparator;
if (separator != null) {
var pen = new Pen(Color.Black);
e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, 1, separator.Height));
}
}
示例7: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
using (Pen linePen = new Pen(Color.FromArgb(131, 146, 165)))
{
linePen.DashPattern = new float[] { 1f, 1f };
Point lineStart = new Point(e.Item.Bounds.Width / 2, e.ToolStrip.Margin.Top);
Point lineEnd = new Point(e.Item.Bounds.Width / 2, e.Item.Bounds.Height - e.ToolStrip.Margin.Bottom);
e.Graphics.DrawLine(linePen, lineStart, lineEnd);
}
}
示例8: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
e.Graphics.Clear(e.Item.BackColor);
RectangleF rect = e.Graphics.ClipBounds;
PointF center = rect.Center();
if (e.Vertical)
e.Graphics.DrawLine(new Pen(e.Item.ForeColor), center.X, rect.Top + 2, center.X, rect.Bottom - 2);
else
e.Graphics.DrawLine(new Pen(e.Item.ForeColor), rect.Left, center.Y, rect.Right, center.Y);
}
示例9: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Rectangle r = e.Item.ContentRectangle;
Color color = Color.MidnightBlue;//Color.FromArgb(255, Color.MidnightBlue);
int x = r.X;
int y1 = r.Y + 2;
int y2 = r.Bottom;
e.Graphics.DrawLine(new Pen(Color.MidnightBlue, 1), x, y1, x, y2);
e.Graphics.DrawLine(new Pen(Color.FromArgb(150, Color.Gray), 1), x + 1, y1 + 1, x + 1, y2 + 1);
}
示例10: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
var g = e.Graphics;
var rect = new Rectangle(1, 3, e.Item.Width, 1);
using (var b = new SolidBrush(Colors.LightBorder))
{
g.FillRectangle(b, rect);
}
}
示例11: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
if (renderer is ToolStripSystemRenderer)
{
if (e.ToolStrip is ToolStripDropDownMenu) renderer.DrawSeparator(e);
else
{
Pen pen = new Pen(SystemColors.InactiveBorder);
Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
e.Graphics.DrawLine(pen, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2);
pen.Dispose();
}
}
else renderer.DrawSeparator(e);
}
示例12: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Rectangle r = new Rectangle(new Point(3, 8), e.Item.Size);
if (e.Item is ToolStripSeparator)
{
r.Width = 1;
r.Height -= 14;
//竖线
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(209, 209, 209)), r);
}
else
{
base.OnRenderSeparator(e);
}
}
示例13: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
if (e.Item is ToolStripSeparator)
{
if (!e.Vertical)
{
ToolStripDropDownMenu parent = e.Item.GetCurrentParent() as ToolStripDropDownMenu;
if (parent != null)
{
renderer.DrawSeparator(e);
return;
}
}
}
base.OnRenderSeparator(e);
}
示例14: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
Rectangle r = new Rectangle(1, 0, e.Item.Bounds.Width - 3, e.Item.Bounds.Height);
r.X += m_sideBorder + m_sideBorder / 2;
r.Width -= 2 * m_sideBorder;
Color color = Color.MidnightBlue;//Color.FromArgb(255, Color.MidnightBlue);
LinearGradientBrush brush1 = new LinearGradientBrush(r, Color.Transparent, color , LinearGradientMode.Horizontal);
LinearGradientBrush brush2 = new LinearGradientBrush(r, color, Color.Transparent, LinearGradientMode.Horizontal);
//Pen pen = new Pen(brush, 1);
int x1 = r.X + 1;
int y = r.Y + r.Height / 2;
int x2 = r.X + r.Width / 2;
int x3 = r.Right - m_sideBorder;
e.Graphics.DrawLine(new Pen(brush1, 1), x1, y, x2, y);
e.Graphics.DrawLine(new Pen(brush2, 1), x2 + 1, y, x3, y);
//e.Graphics.DrawLine(pen, new Point(r.X, r.Y + r.Height / 2), new Point(r.Right - 5, r.Y + r.Height / 2));
}
示例15: OnRenderSeparator
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
{
//base.OnRenderSeparator(e);
if (e.Vertical)
{
int size = e.ToolStrip.Height * 3 / 4;
int midX = e.Item.Width / 2;
int midY = e.ToolStrip.Height / 2;
e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.Black)), midX, midY - size / 2, midX, midY + size / 2);
e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.White)), midX + 1, midY - size / 2, midX + 1, midY + size / 2);
}
else
{
int size = e.ToolStrip.Width * 3 / 4;
int midX = e.Item.Width / 2;
int midY = e.ToolStrip.Width / 2;
e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.Black)), midX - size / 2, midY, midX + size / 2, midY);
e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.White)), midX - size / 2, midY + 1, midX + size / 2, midY + 1);
}
}