• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.ToolStripSeparatorRenderEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.ToolStripSeparatorRenderEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ToolStripSeparatorRenderEventArgs类的具体用法?C# ToolStripSeparatorRenderEventArgs怎么用?C# ToolStripSeparatorRenderEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ToolStripSeparatorRenderEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripSeparatorRenderEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: OnRenderSeparator

 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if ((e.ToolStrip is ContextMenuStrip) ||
     (e.ToolStrip is ToolStripDropDownMenu))
     {
         using (Pen lightPen = new Pen(Color.FromArgb(208, 234, 247)), darkPen = new Pen(Color.FromArgb(219, 238, 252)))
         {
             DrawSeparator(e.Graphics, e.Vertical, new Rectangle(0, 0, e.Item.Width - 5, 3), lightPen, darkPen, 31, (e.ToolStrip.RightToLeft == RightToLeft.Yes));
         }
     }
     else if (e.ToolStrip is System.Windows.Forms.StatusStrip)
     {
         using (Pen lightPen = new Pen(ColorTable.SeparatorLight), darkPen = new Pen(ColorTable.SeparatorDark))
         {
             DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds, lightPen, darkPen, 0, false);
         }
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
开发者ID:seaman,项目名称:MagicMongoDBTool,代码行数:22,代码来源:ProfessionalToolStripRendererEx.cs


示例17: OnRenderSeparator

 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     e.Graphics.FillRectangle(new SolidBrush(QLFUI.IniHelper.BackColor), new Rectangle(0, 0, e.Item.Width, e.Item.Height));
     if ((e.ToolStrip is ContextMenuStrip) ||
     (e.ToolStrip is ToolStripDropDownMenu))
     {
         using (Pen lightPen = new Pen(QLFUI.IniHelper.DeepColor), darkPen = new Pen(QLFUI.IniHelper.DeepColor))
         {
             DrawSeparator(e.Graphics, e.Vertical, new Rectangle(0, 0, e.Item.Width - 5, 3), lightPen, darkPen, 0, (e.ToolStrip.RightToLeft == RightToLeft.Yes));
         }
     }
     else if (e.ToolStrip is System.Windows.Forms.StatusStrip)
     {
         using (Pen lightPen = new Pen(ColorTable.SeparatorLight), darkPen = new Pen(ColorTable.SeparatorDark))
         {
             DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds, lightPen, darkPen, 0, false);
         }
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
开发者ID:kklik,项目名称:MagicMongoDBTool,代码行数:23,代码来源:ProfessionalToolStripRendererEx.cs


示例18: OnRenderSeparator

        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            if (
                e.ToolStrip is ContextMenuStrip ||
                e.ToolStrip is ToolStripDropDownMenu
                )
            {
                // Draw it

                e.Graphics.DrawLine(new Pen(_mnuManager.SeperatorDark), _mnuManager.SeperatorInset, 3, e.Item.Width + 1, 3);
                e.Graphics.DrawLine(new Pen(_mnuManager.SeperatorLight), _mnuManager.SeperatorInset, 4, e.Item.Width + 1, 4);
            }
            else
            {
                if (e.Vertical)
                {
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorDark), 3, 5, 3, e.Item.Height - 6);
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorLight), 4, 6, 4, e.Item.Height - 6);
                }
                else
                {
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorDark), 8, 0, e.Item.Width - 6, 0);
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorLight), 9, 1, e.Item.Width - 6, 1);
                }
            }
        }
开发者ID:nicholatian,项目名称:monody,代码行数:26,代码来源:EasyRenderBase.cs


示例19: OnRenderSeparator

        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            base.OnRenderSeparator(e);

            PaintItem(e.Graphics, e.Item.ContentRectangle,
                ColorTable.ButtonNormalEnd,
                ColorTable.ButtonNormalEnd);
        }
开发者ID:jorik041,项目名称:water-utility-mobile-map,代码行数:8,代码来源:NavigateBarRenderer.cs


示例20: DrawSeparator

 public void DrawSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     this.OnRenderSeparator(e);
     ToolStripSeparatorRenderEventHandler handler = this.Events[EventRenderSeparator] as ToolStripSeparatorRenderEventHandler;
     if (handler != null)
     {
         handler(this, e);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ToolStripRenderer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ToolStripSplitButton类代码示例发布时间:2022-05-26
下一篇:
C# Forms.ToolStripSeparator类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap