本文整理汇总了C#中System.Windows.Forms.ToolStripRenderEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripRenderEventArgs类的具体用法?C# ToolStripRenderEventArgs怎么用?C# ToolStripRenderEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripRenderEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripRenderEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
if (e.ToolStrip is ToolStripDropDown)
base.OnRenderToolStripBackground(e);
else
e.Graphics.FillRectangle(SystemBrushes.Control, e.AffectedBounds);
}
示例2: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
var g = e.Graphics;
g.FillRectangle(UserBrushes.Window, e.AffectedBounds);
g.DrawRectangle(UserPens.Border, new Rectangle(0, 0, e.AffectedBounds.Width - 1, e.AffectedBounds.Height - 1));
g.DrawLine(UserPens.Window, 1, 0, e.AffectedBounds.Width - 2, 0);
}
示例3: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
Color start = _startColor;
Color end = _endColor;
ToolStrip toolStrip = e.ToolStrip;
Graphics g = e.Graphics;
int boundsHeight = e.AffectedBounds.Height;
int height = (boundsHeight + _lines - 1) / _lines;
int width = e.AffectedBounds.Width;
int stripeHeight = height - 1;
Rectangle stripeRect;
using (Brush b = new LinearGradientBrush(new Rectangle(0, 0, width, stripeHeight), start, end, LinearGradientMode.Horizontal))
{
for (int idx = 0; idx < _lines; idx++)
{
stripeRect = new Rectangle(0, height * idx + 1, width, stripeHeight);
g.FillRectangle(b, stripeRect);
}
}
if (this.DrawEndLine)
{
using (Brush solidBrush = new SolidBrush(Color.FromArgb(177, 177, 177)))
{
g.FillRectangle(solidBrush, new Rectangle(0, boundsHeight - 1, width, 1));
}
}
}
示例4: RenderToolStripBorderInternal
private void RenderToolStripBorderInternal(ToolStripRenderEventArgs e)
{
Rectangle rectangle = new Rectangle(Point.Empty, e.ToolStrip.Size);
Graphics graphics = e.Graphics;
using (Pen pen = new Pen(SystemColors.ButtonShadow))
{
pen.DashStyle = DashStyle.Dot;
bool flag = (rectangle.Width & 1) == 1;
bool flag2 = (rectangle.Height & 1) == 1;
int num = 2;
graphics.DrawLine(pen, rectangle.X + num, rectangle.Y, rectangle.Width - 1, rectangle.Y);
graphics.DrawLine(pen, (int) (rectangle.X + num), (int) (rectangle.Height - 1), (int) (rectangle.Width - 1), (int) (rectangle.Height - 1));
graphics.DrawLine(pen, rectangle.X, rectangle.Y + num, rectangle.X, rectangle.Height - 1);
graphics.DrawLine(pen, (int) (rectangle.Width - 1), (int) (rectangle.Y + num), (int) (rectangle.Width - 1), (int) (rectangle.Height - 1));
graphics.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(1, 1, 1, 1));
if (flag)
{
graphics.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(rectangle.Width - 2, 1, 1, 1));
}
if (flag2)
{
graphics.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(1, rectangle.Height - 2, 1, 1));
}
if (flag2 && flag)
{
graphics.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(rectangle.Width - 2, rectangle.Height - 2, 1, 1));
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:ToolStripProfessionalLowResolutionRenderer.cs
示例5: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
base.OnRenderToolStripBackground(e);
if (e.ToolStrip is ToolStripDropDownMenu) return;
using (LinearGradientBrush lgBrush = new LinearGradientBrush(Point.Empty, new PointF(0, e.ToolStrip.Height),
ToolStripColorTable.ToolStripBackgroundTop, ToolStripColorTable.ToolStripBackgroundBottom))
{
ColorBlend blend = new ColorBlend(3);
blend.Colors = new Color[] { ToolStripColorTable.ToolStripBackgroundTop,
ToolStripColorTable.ToolStripBackgroundMiddle,ToolStripColorTable.ToolStripBackgroundMiddle,
ToolStripColorTable.ToolStripBackgroundBottom};
blend.Positions = new float[] { 0.0f, 0.33f,0.58f, 1.0f };
lgBrush.InterpolationColors = blend;
using (GraphicsPath border = GetToolStripRectangle(e.ToolStrip))
{
e.Graphics.FillPath(lgBrush, border);
e.Graphics.DrawLine(new Pen( ToolStripColorTable.ToolStripBackgroundTopLine), 0, 0, e.ToolStrip.Width, 0);
e.Graphics.DrawLine(new Pen( ToolStripColorTable.ToolStripBackgroundBottomLine), 0, e.ToolStrip.Height - 2,
e.ToolStrip.Width, e.ToolStrip.Height - 2);
}
}
}
示例6: OnRenderToolStripBorder
protected override void OnRenderToolStripBorder( ToolStripRenderEventArgs e ) {
if (e.ToolStrip.GetType() == typeof(ToolStrip)) {
} else {
base.OnRenderToolStripBorder(e);
}
}
示例7: OnRenderToolStripBackground
protected virtual void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
if (StackStripRenderer != null)
{
// Setup colors from the provided renderer
Color start = StackStripRenderer.ColorTable.ToolStripGradientMiddle;
Color end = StackStripRenderer.ColorTable.ToolStripGradientEnd;
// Size to paint
Rectangle bounds = new Rectangle(Point.Empty, e.ToolStrip.Size);
// Make sure we need to do work
if ((bounds.Width > 0) && (bounds.Height > 0))
{
using (Brush b = new LinearGradientBrush(bounds, start, end, LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(b, bounds);
}
}
// Draw border
//e.Graphics.DrawRectangle(SystemPens.ControlDarkDark, bounds);
e.Graphics.DrawLine(SystemPens.ControlDarkDark, bounds.X, bounds.Y, bounds.Width - 1, bounds.Y);
e.Graphics.DrawLine(SystemPens.ControlDarkDark, bounds.X, bounds.Y, bounds.X, bounds.Height - 1);
e.Graphics.DrawLine(SystemPens.ControlDarkDark, bounds.X + bounds.Width - 1, bounds.Y, bounds.X + bounds.Width - 1, bounds.Height - 1);
}
}
示例8: OnRenderToolStripBorder
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
{
if (ShowBorder)
{
ThemeManager.PrepareGraphics(e.Graphics);
using (Pen p = new Pen(ThemeManager.SelectedColor, 1))
{
Point p1, p2 = Point.Empty;
if (VerticalGradient)
{
p1 = new Point(e.AffectedBounds.Left, e.AffectedBounds.Bottom - 1);
p2 = new Point(e.AffectedBounds.Right, e.AffectedBounds.Bottom - 1);
}
else
{
p1 = new Point(e.AffectedBounds.Right - 1, e.AffectedBounds.Top);
p2 = new Point(e.AffectedBounds.Right - 1, e.AffectedBounds.Bottom);
}
e.Graphics.DrawLine(p, p1, p2);
}
}
}
示例9: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
using (Brush bgBrush = new SolidBrush(this.colors.ToolStripDropDownBackground))
{
e.Graphics.FillRectangle(bgBrush, e.AffectedBounds);
}
}
示例10: OnRenderToolStripBorder
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
{
var bounds = new Rectangle(Point.Empty, e.ToolStrip.Size);
using (Pen pen = new Pen(NavigationColourTable.BACK_COLOR))
e.Graphics.DrawRectangle(pen, bounds);
}
示例11: OnRenderToolStripBorder
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
{
if (e.ToolStrip.Name == "toolStrip1")
{
base.OnRenderToolStripBorder(e);
}
}
示例12: OnRenderToolStripBorder
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
{
if (e.ToolStrip is ToolStripDropDown)
{
base.OnRenderToolStripBorder(e);
}
}
示例13: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
Rectangle rect = e.AffectedBounds;
Brush b = new LinearGradientBrush(rect, this.ColorTable.StatusStripGradientBegin,
this.ColorTable.StatusStripGradientEnd, 270.0f);
e.Graphics.FillRectangle(b, rect);
}
示例14: OnRenderToolStripBackground
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) {
GraphicsHelper helper = new GraphicsHelper(e.Graphics);
Rectangle bounds = new Rectangle(-1, -1, e.AffectedBounds.Width + 1, e.AffectedBounds.Height + 1);
//helper.Clear(UColor.Argb(255, 0, 0, 0));
helper.Gradient(UColor.Rgb(0x30, 0x30, 0x30), UColor.Rgb(0x1D, 0x1D, 0x1D), bounds, 90);
}
示例15: OnRenderImageMargin
protected override void OnRenderImageMargin(ToolStripRenderEventArgs e)
{
base.OnRenderImageMargin(e);
// Gray background
using (var brush = new SolidBrush(RendererColors.SubmenuBackGround))
e.Graphics.FillRectangle(brush, 0, 0, e.ToolStrip.Width, e.ToolStrip.Height);
// Draw ImageMargin background gradient
using (var gradientBrush = new LinearGradientBrush(
e.AffectedBounds,
RendererColors.ImageMarginWhite,
RendererColors.ImageMarginBlue,
LinearGradientMode.Horizontal))
e.Graphics.FillRectangle(gradientBrush, e.AffectedBounds);
// Shadow at the right of image margin
var rightStroke1 = new Rectangle(e.AffectedBounds.Width, 2, 1, e.AffectedBounds.Height);
var rightStroke2 = new Rectangle(e.AffectedBounds.Width + 1, 2, 1, e.AffectedBounds.Height);
using (var darkLineBrush = new SolidBrush(RendererColors.ImageMarginLine))
e.Graphics.FillRectangle(darkLineBrush, rightStroke1);
e.Graphics.FillRectangle(Brushes.White, rightStroke2);
// Border
using (var borderPen = new Pen(RendererColors.MenuBorder))
{
var toolStripInner = new Rectangle(0, 1, e.ToolStrip.Width - 1, e.ToolStrip.Height - 2);
e.Graphics.DrawRectangle(borderPen, toolStripInner);
}
}