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)); } } }
protected override void OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) { using (Pen pen = new Pen(AddColor(Theme, -100))) { e.Graphics.DrawRectangle(pen, 0, 0, e.ToolStrip.Width - 1, e.ToolStrip.Height - 1); } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { if (e.ToolStrip is ToolStripDropDown) base.OnRenderToolStripBackground(e); else e.Graphics.FillRectangle(SystemBrushes.Control, e.AffectedBounds); }
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); }
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)); } } }
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); }
protected override void OnRenderToolStripBorder( ToolStripRenderEventArgs e ) { if (e.ToolStrip.GetType() == typeof(ToolStrip)) { } else { base.OnRenderToolStripBorder(e); } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { using (Brush bgBrush = new SolidBrush(this.colors.ToolStripDropDownBackground)) { e.Graphics.FillRectangle(bgBrush, e.AffectedBounds); } }
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); } } }
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); } }
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); } }
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); }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { var pen = new Pen(SystemColors.HotTrack); var rectangle = e.AffectedBounds; rectangle.Offset(0, -1); e.Graphics.DrawRectangle(pen, rectangle); }
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); } } }
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); }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { if (e.ToolStrip.Name == "toolStrip1") { base.OnRenderToolStripBorder(e); } }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { if (e.ToolStrip is ToolStripDropDown) { base.OnRenderToolStripBorder(e); } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { using (SolidBrush brush = new SolidBrush(BACKGROUND_COLOR)) { e.Graphics.FillRectangle(brush, e.AffectedBounds); } }
/// <summary></summary> protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { base.OnRenderToolStripBackground(e); var brush = new LinearGradientBrush((Rectangle)e.ToolStrip.ClientRectangle, itemArea_backgroundColor_top, itemArea_backgroundColor_bottom, 90, true); e.Graphics.FillRectangle(brush, e.AffectedBounds); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { Rectangle rect = e.AffectedBounds; using (SolidBrush brush = new SolidBrush(Color.White)) { e.Graphics.FillRectangle(brush, rect); } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { using (Brush brush = new SolidBrush(this.ToolStrip == null ? e.BackColor : this.ToolStrip.BackColor)) // SystemColors.ControlDark { e.Graphics.FillRectangle(brush, e.AffectedBounds); } // base.OnRenderToolStripBackground(e); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { var g = e.Graphics; using (var b = new SolidBrush(Colors.GreyBackground)) { g.FillRectangle(b, e.AffectedBounds); } }
/// <summary> /// Removes the border on the right of the tool strip /// </summary> /// <param name="sender">the renderer</param> /// <param name="e">the event args</param> void Renderer_RenderToolStripBorder(object sender, ToolStripRenderEventArgs e) { if (e.ToolStrip.GetType() != typeof(ToolStrip)) return; e.Graphics.DrawLine(new Pen(new SolidBrush(SystemColors.Control)), new Point(toolStrip.Width - 1, 0), new Point(toolStrip.Width - 1, toolStrip.Height)); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { if (EnsureRenderer()) { Renderer.SetParameters(FlyoutWindow); Renderer.DrawBackground(e.Graphics, e.AffectedBounds); } }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { if (e.ToolStrip.IsDropDown) { e.Graphics.DrawLine(new Pen(Palette.MenuBorder), 0, 0, 0, (int)e.Graphics.ClipBounds.Bottom); e.Graphics.DrawLine(new Pen(Palette.MenuPressed), 1, 0, 1, (int)e.Graphics.ClipBounds.Bottom); } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { base.OnRenderToolStripBackground(e); if (e.ToolStrip.IsDropDown && e.ToolStrip is ToolStripOverflow) { e.Graphics.FillRectangle(new SolidBrush(e.BackColor), e.AffectedBounds); } }
protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) { e.Graphics.FillRectangle(new SolidBrush(bgColor1), new Rectangle(0, 0, e.ToolStrip.Width, e.ToolStrip.Height)); e.Graphics.FillRectangle(new SolidBrush(bgColor1), e.AffectedBounds); e.Graphics.FillRectangle(new SolidBrush(bgColor1), new Rectangle(e.AffectedBounds.Width, 2, 1, e.AffectedBounds.Height)); base.OnRenderImageMargin(e); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { Graphics g = e.Graphics; using (Brush b = new SolidBrush(Color.FromArgb(91, 91, 91))) { g.FillRectangle(b, e.Graphics.ClipBounds); } }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { base.OnRenderToolStripBorder(e); Rectangle _r = e.ConnectedArea; _r.Height = 1; e.Graphics.FillRectangle(Brushes.Gray, _r); }
protected override void OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs e) { if (currentRenderer != null) { currentRenderer.DrawToolStripBackground(e); return; } base.OnRenderToolStripBackground(e); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { Graphics g = e.Graphics; LinearGradientBrush b = new LinearGradientBrush(e.AffectedBounds, Color.DarkGray, Color.Black, 90); g.FillRectangle(b, e.AffectedBounds); b.Dispose(); base.OnRenderToolStripBackground(e); }
protected override void OnRenderStatusStripSizingGrip(System.Windows.Forms.ToolStripRenderEventArgs e) { if (currentRenderer != null) { currentRenderer.DrawStatusStripSizingGrip(e); return; } base.OnRenderStatusStripSizingGrip(e); }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { base.OnRenderToolStripBorder(e); Rectangle rect = e.AffectedBounds; e.Graphics.DrawLine(new Pen(Color.FromKnownColor(KnownColor.ControlDark)), rect.Left, rect.Bottom, rect.Right, rect.Bottom); return; }
protected override void OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs e) { if (currentRenderer != null) { currentRenderer.DrawImageMargin(e); return; } base.OnRenderImageMargin(e); }
protected override void OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs e) { e.Graphics.Clear(AddColor(Theme, 100)); Rectangle bounds = new Rectangle(0, 0, 26, e.ToolStrip.Height); using (LinearGradientBrush brush = new LinearGradientBrush(bounds, AddColor(Theme, 50), Theme, LinearGradientMode.Horizontal)) { e.Graphics.FillRectangle(brush, bounds); } }
protected override void OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs e) { base.OnRenderToolStripBackground(e); // Menu strip bar gradient using (LinearGradientBrush LGB = new LinearGradientBrush(e.AffectedBounds, this.ColorTable.BackgroundTopGradient, this.ColorTable.BackgroundBottomGradient, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(LGB, e.AffectedBounds); } }
// Render the background of an actual menu bar, dropdown menu or toolbar. protected override void OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs e) { if (EnsureRenderer()) { if (e.ToolStrip.IsDropDown) { renderer.SetParameters(MenuClass, (int)MenuParts.PopupBackground, 0); } else { // It's a MenuStrip or a ToolStrip. If it's contained inside a larger panel, it should have a // transparent background, showing the panel's background. if (e.ToolStrip.Parent is ToolStripPanel) { // The background should be transparent, because the ToolStripPanel's background will be visible. // (Of course, we assume the ToolStripPanel is drawn using the same theme, but it's not my fault // if someone does that.) return; } else { // A lone toolbar/menubar should act like it's inside a toolbox, I guess. // Maybe I should use the MenuClass in the case of a MenuStrip, although that would break // the other themes... if (VisualStyleRenderer.IsElementDefined(VisualStyleElement.CreateElement(RebarClass, RebarBackground, 0))) { renderer.SetParameters(RebarClass, RebarBackground, 0); } else { renderer.SetParameters(RebarClass, 0, 0); } } } if (renderer.IsBackgroundPartiallyTransparent()) { renderer.DrawParentBackground(e.Graphics, e.ToolStrip.ClientRectangle, e.ToolStrip); } if (DrawBackground) { renderer.DrawBackground(e.Graphics, e.ToolStrip.ClientRectangle, e.AffectedBounds); } } else { base.OnRenderToolStripBackground(e); } }
protected override void OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs e) { base.OnRenderImageMargin(e); Rectangle BackgroundRect = new Rectangle(0, -1, e.ToolStrip.Width, e.ToolStrip.Height + 1); using (LinearGradientBrush LGB = new LinearGradientBrush(BackgroundRect, this.ColorTable.DropdownTopGradient, this.ColorTable.DropdownBottomGradient, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(LGB, BackgroundRect); } using (SolidBrush B1 = new SolidBrush(this.ColorTable.ImageMargin)) { e.Graphics.FillRectangle(B1, e.AffectedBounds); } }
protected override void OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) { if (e.ToolStrip.Parent == null) { // Draw border around the menu drop-down Rectangle Rect = new Rectangle(0, 0, e.ToolStrip.Width - 1, e.ToolStrip.Height - 1); using (Pen P1 = new Pen(this.ColorTable.CommonColorTable.DropdownBorder)) { e.Graphics.DrawRectangle(P1, Rect); } // Fill the gap between menu drop-down and owner item using (SolidBrush B1 = new SolidBrush(this.ColorTable.DroppedDownItemBackground)) { e.Graphics.FillRectangle(B1, e.ConnectedArea); } } }
protected override void OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) { if (OsUtils.WinVistaOrLater() && VisualStyleRenderer.IsSupported) { if (!OsUtils.CompositionEnabled()) { e.Graphics.DrawLine(this.nonAeroBorder, 0, e.AffectedBounds.Bottom - 1, e.ToolStrip.Width, e.AffectedBounds.Bottom - 1); } } else { e.Graphics.DrawLine(this.tabBorder, 0, e.AffectedBounds.Bottom - 1, e.ToolStrip.Width, e.AffectedBounds.Bottom - 1); } ToolStripButton @checked = null; // Find the currently checked ToolStripButton foreach (ToolStripItem item in e.ToolStrip.Items) { ToolStripButton buttonItem = item as ToolStripButton; if (buttonItem != null && buttonItem.Checked) { @checked = buttonItem; break; } } if (@checked != null) { // Extend the bottom of the tab over the client area border, joining the tab onto the main client area using (SolidBrush toolbarBkg = new SolidBrush(this.GetActiveTabBtmCol(e.ToolStrip, @checked))) { e.Graphics.FillRectangle(toolbarBkg, new Rectangle(@checked.Bounds.Left, @checked.Bounds.Bottom, @checked.Bounds.Width - TabSeparation, e.ToolStrip.Bounds.Bottom - @checked.Bounds.Bottom)); } e.Graphics.DrawLine(this.tabBorder, @checked.Bounds.Left, @checked.Bounds.Bottom, @checked.Bounds.Left, e.AffectedBounds.Bottom); e.Graphics.DrawLine(this.tabBorder, @checked.Bounds.Right - TabSeparation, @checked.Bounds.Bottom, @checked.Bounds.Right - TabSeparation, e.AffectedBounds.Bottom); } }
protected override void OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs e) { if (OsUtils.CompositionEnabled()) { // Set the background colour to transparent to make it glass e.Graphics.Clear(Color.Transparent); } else { if (VisualStyleRenderer.IsSupported && OsUtils.WinVistaOrLater()) { // Set the background the same as the title bar to give the illusion of an extended frame if (this.isActive) { // It would be simpler to use e.Graphics.Clear(SystemColors.GradientActiveCaption), but // that crashes sometimes when running under terminal services due to a bug in GDI+ using (Brush backgroundBrush = new SolidBrush(SystemColors.GradientActiveCaption)) { e.Graphics.FillRectangle(backgroundBrush, e.AffectedBounds); } } else { // It would be simpler to use e.Graphics.Clear(SystemColors.GradientInactiveCaption), but // that crashes sometimes when running under terminal services due to a bug in GDI+ using (Brush backgroundBrush = new SolidBrush(SystemColors.GradientInactiveCaption)) { e.Graphics.FillRectangle(backgroundBrush, e.AffectedBounds); } } } else { base.OnRenderToolStripBackground(e); } } }
protected override void OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs e) { base.OnRenderImageMargin(e); var b = new LinearGradientBrush(e.AffectedBounds, ColorImageMarginWhite, ColorImageMarginBlue, LinearGradientMode.Horizontal); var DarkLine = new SolidBrush(ColorImageMarginLine); var WhiteLine = new SolidBrush(Color.White); var rect = new Rectangle(e.AffectedBounds.Width, 2, 1, e.AffectedBounds.Height); var rect2 = new Rectangle(e.AffectedBounds.Width + 1, 2, 1, e.AffectedBounds.Height); var SubmenuBGbrush = new SolidBrush(ColorSubmenuBG); var rect3 = new Rectangle(0, 0, e.ToolStrip.Width, e.ToolStrip.Height); var borderPen = new Pen(ColorMenuBorder); var rect4 = new Rectangle(0, 1, e.ToolStrip.Width - 1, e.ToolStrip.Height - 2); e.Graphics.FillRectangle(SubmenuBGbrush, rect3); e.Graphics.FillRectangle(b, e.AffectedBounds); e.Graphics.FillRectangle(DarkLine, rect); e.Graphics.FillRectangle(WhiteLine, rect2); e.Graphics.DrawRectangle(borderPen, rect4); }
protected override void OnRenderStatusStripSizingGrip(ToolStripRenderEventArgs e) { base.OnRenderStatusStripSizingGrip(e); }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { // do nothing. LOGO requirements ask us not to paint background effects behind }
protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) { renderer.DrawImageMargin(e); }
protected override void OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) { // decompiler error }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { Color c = SystemColors.AppWorkspace; if (UseVS) { VisualStyleRenderer rndr = new VisualStyleRenderer(VisualStyleElement.Tab.Pane.Normal); c = rndr.GetColor(ColorProperty.BorderColorHint); } using (Pen p = new Pen(c)) using (Pen p2 = new Pen(e.BackColor)) { Rectangle r = e.ToolStrip.Bounds; int x1 = (Mirrored) ? 0 : r.Width - 1 - e.ToolStrip.Padding.Horizontal; int y1 = (Mirrored) ? 0 : r.Height - 1; if (e.ToolStrip.Orientation == Orientation.Horizontal) { e.Graphics.DrawLine(p, 0, y1, r.Width, y1); } else { e.Graphics.DrawLine(p, x1, 0, x1, r.Height); if (!Mirrored) { for (int i = x1 + 1; i < r.Width; i++) { e.Graphics.DrawLine(p2, i, 0, i, r.Height); } } } foreach (ToolStripItem x in e.ToolStrip.Items) { if (x.IsOnOverflow) { continue; } TabStripButton btn = x as TabStripButton; if (btn == null) { continue; } Rectangle rc = btn.Bounds; int x2 = (Mirrored) ? rc.Left : rc.Right; int y2 = (Mirrored) ? rc.Top : rc.Bottom - 1; int addXY = (Mirrored) ? 0 : 1; if (e.ToolStrip.Orientation == Orientation.Horizontal) { e.Graphics.DrawLine(p, rc.Left, y2, rc.Right, y2); if (btn.Checked) { e.Graphics.DrawLine(p2, rc.Left + 2 - addXY, y2, rc.Right - 2 - addXY, y2); } } else { e.Graphics.DrawLine(p, x2, rc.Top, x2, rc.Bottom); if (btn.Checked) { e.Graphics.DrawLine(p2, x2, rc.Top + 2 - addXY, x2, rc.Bottom - 2 - addXY); } } } } }
protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { ToolStripRenderEventArgs ea = new ToolStripRenderEventArgs(e.Graphics, e.ToolStrip, new Rectangle(-10, -3, e.AffectedBounds.Width + 20, e.AffectedBounds.Height + 6), e.BackColor); renderer.DrawToolStripBackground(ea); }
//' This method handles the RenderToolStripBorder event. protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { }
protected virtual void OnRenderStatusStripSizingGrip(ToolStripRenderEventArgs e) { throw null; }
public void DrawImageMargin(ToolStripRenderEventArgs e) { this.OnRenderImageMargin(e); }
protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) { // do nothing }
protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) { base.OnRenderImageMargin(e); }
public void DrawToolStripBorder(ToolStripRenderEventArgs e) { this.OnRenderToolStripBorder(e); }
public void DrawToolStripBackground(ToolStripRenderEventArgs e) { this.OnRenderToolStripBackground(e); }
protected override void OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs e) { // don't call base //base.OnRenderToolStripBorder(e); }
protected virtual void OnRenderImageMargin(ToolStripRenderEventArgs e) { throw null; }
public void DrawStatusStripSizingGrip(ToolStripRenderEventArgs e) { this.OnRenderStatusStripSizingGrip(e); }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) { ThemeElements.CurrentTheme.ToolStripPainter.OnRenderToolStripBorder(e); base.OnRenderToolStripBorder(e); }
protected override void OnRenderStatusStripSizingGrip(ToolStripRenderEventArgs e) { renderer.DrawStatusStripSizingGrip(e); }