當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ToolStripRenderEventArgs類代碼示例

本文整理匯總了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);
 }
開發者ID:netide,項目名稱:netide,代碼行數:7,代碼來源:ToolStripSimpleRenderer.cs

示例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);
 }
開發者ID:rizwan3d,項目名稱:elalang,代碼行數:7,代碼來源:DocumentMenuRenderer.cs

示例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));
                }
            }
        }
開發者ID:atan888,項目名稱:MMS,代碼行數:31,代碼來源:HeaderRenderer.cs

示例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);
                }
            }

        }
開發者ID:Vinna,項目名稱:DeepInSummer,代碼行數:26,代碼來源:ToolStripRender.cs

示例6: OnRenderToolStripBorder

		protected override void OnRenderToolStripBorder( ToolStripRenderEventArgs e ) {
			if (e.ToolStrip.GetType() == typeof(ToolStrip)) {

			} else {
				base.OnRenderToolStripBorder(e);
			}
		}
開發者ID:mibbio,項目名稱:PoE-Helper,代碼行數:7,代碼來源:FixedToolstripRenderer.cs

示例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);
			}
		}
開發者ID:haoasqui,項目名稱:MailSystem.NET,代碼行數:27,代碼來源:BaseStackStrip.cs

示例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);
                }
            }
        }
開發者ID:rraguso,項目名稱:protone-suite,代碼行數:25,代碼來源:ToolAndMenuStrips.cs

示例9: OnRenderToolStripBackground

 protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
 {
    using (Brush bgBrush = new SolidBrush(this.colors.ToolStripDropDownBackground))
    {
       e.Graphics.FillRectangle(bgBrush, e.AffectedBounds);
    }
 }
開發者ID:Sugz,項目名稱:Outliner-3.0,代碼行數:7,代碼來源:OutlinerToolStripRenderer.cs

示例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);
 }
開發者ID:huizh,項目名稱:xenadmin,代碼行數:7,代碼來源:NavigationToolStripRenderer.cs

示例11: OnRenderToolStripBorder

 protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
 {
     if (e.ToolStrip.Name == "toolStrip1")
     {
         base.OnRenderToolStripBorder(e);
     }
 }
開發者ID:jasperdj,項目名稱:Playground,代碼行數:7,代碼來源:Program.cs

示例12: OnRenderToolStripBorder

 protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
 {
     if (e.ToolStrip is ToolStripDropDown)
     {
         base.OnRenderToolStripBorder(e);
     }
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:7,代碼來源:BorderLessToolStripRenderer.cs

示例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);
 }
開發者ID:westybsa,項目名稱:MP.LSharp,代碼行數:7,代碼來源:ToolStripRenderers.cs

示例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);
			}
開發者ID:Hakua,項目名稱:PokeSharp,代碼行數:7,代碼來源:ToolBar.cs

示例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);
            }
        }
開發者ID:sagar1589,項目名稱:Delta.Cryptography,代碼行數:30,代碼來源:VisualStudio2008Renderer.cs


注:本文中的System.Windows.Forms.ToolStripRenderEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。