當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。