当前位置: 首页>>代码示例>>C#>>正文


C# Forms.ToolStripSeparatorRenderEventArgs类代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:wenysky,项目名称:deepinsummer,代码行数:25,代码来源:ToolStripRender.cs

示例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);
        }
开发者ID:CryogenicTyrant,项目名称:Ohana3DS-Rebirth,代码行数:8,代码来源:OMenuStrip.cs

示例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);
     }
 }
开发者ID:yienit,项目名称:KST,代码行数:8,代码来源:NuiContextMenuStripRender.cs

示例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);
		}
开发者ID:Heitx,项目名称:Starbounder,代码行数:8,代码来源:ToolStrips.cs

示例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);
        }
开发者ID:PokeD,项目名称:Ohana3DS-Rebirth,代码行数:9,代码来源:OMenuStrip.cs

示例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));
            }
        }
开发者ID:cube-soft,项目名称:CubePdfViewer,代码行数:13,代码来源:CustomToolStripRenderer.cs

示例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);
              }
        }
开发者ID:abibell,项目名称:mysql-workbench,代码行数:11,代码来源:WbToolStripRenderers.cs

示例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);
        }
开发者ID:Xambey,项目名称:MAIDE,代码行数:11,代码来源:MenuPaletteRenderer.cs

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

        }
开发者ID:schultzisaiah,项目名称:just-gestures,代码行数:11,代码来源:MyToolStripRenderer.cs

示例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);
            }
        }
开发者ID:ZANEKEVIN,项目名称:DarkUI,代码行数:11,代码来源:DarkMenuRenderer.cs

示例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);
 }
开发者ID:heon21st,项目名称:flashdevelop,代码行数:15,代码来源:DockPanelStripRenderer.cs

示例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);
            }
        }
开发者ID:450640526,项目名称:HtmExplorer,代码行数:16,代码来源:CustomToolStripRenderer.cs

示例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);
        }
开发者ID:JamesLinus,项目名称:sharpshell,代码行数:17,代码来源:ToolStripRenderers.cs

示例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));            
        }
开发者ID:schultzisaiah,项目名称:just-gestures,代码行数:18,代码来源:MyContextMenuRenderer.cs

示例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);
			}
		}
开发者ID:KSLcom,项目名称:duality,代码行数:20,代码来源:DualitorToolStripRenderer.cs


注:本文中的System.Windows.Forms.ToolStripSeparatorRenderEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。