public override void Paint(PaintEventArgs pe)
 {
     if (_ribbon.CaptionBarVisible && _ribbon.QuickAccessToolbar.Visible)
     {
         SmoothingMode smbuff = pe.Graphics.SmoothingMode;
         pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
         using (SolidBrush b = new SolidBrush(Color.FromArgb(50, Color.Blue)))
         {
             pe.Graphics.FillEllipse(b, Bounds);
         }
         StringFormat sf = StringFormatFactory.Center();
         pe.Graphics.DrawString("+", SystemFonts.DefaultFont, Brushes.White, Bounds, sf);
         pe.Graphics.SmoothingMode = smbuff;
     }
 }
Esempio n. 2
0
        public override void Paint(PaintEventArgs pe)
        {
            SmoothingMode smbuff = pe.Graphics.SmoothingMode;

            pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            using (GraphicsPath p = RibbonProfessionalRenderer.RoundRectangle(Bounds, 2))
            {
                using (SolidBrush b = new SolidBrush(Color.FromArgb(50, Color.Blue)))
                {
                    pe.Graphics.FillPath(b, p);
                }
            }
            StringFormat sf = StringFormatFactory.Center();

            pe.Graphics.DrawString("Add Tab", SystemFonts.DefaultFont, Brushes.White, Bounds, sf);
            pe.Graphics.SmoothingMode = smbuff;
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Ribbon.Renderer.OnRenderOrbDropDownBackground(
                new RibbonOrbDropDownEventArgs(Ribbon, this, e.Graphics, e.ClipRectangle));

            foreach (RibbonItem item in AllItems)
            {
                item.OnPaint(this, new RibbonElementPaintEventArgs(e.ClipRectangle, e.Graphics, RibbonElementSizeMode.DropDown));
            }

            if (RibbonInDesignMode)
            {
                using (SolidBrush b = new SolidBrush(Color.FromArgb(50, Color.Blue)))
                {
                    e.Graphics.FillRectangle(b, ButtonsGlyphBounds);
                    e.Graphics.FillRectangle(b, RecentGlyphBounds);
                    e.Graphics.FillRectangle(b, OptionGlyphBounds);
                    e.Graphics.FillRectangle(b, ButtonsSeparatorGlyphBounds);
                }

                using (StringFormat sf = StringFormatFactory.Center(StringTrimming.None))
                {
                    e.Graphics.DrawString("+", Font, Brushes.White, ButtonsGlyphBounds, sf);
                    e.Graphics.DrawString("+", Font, Brushes.White, RecentGlyphBounds, sf);
                    e.Graphics.DrawString("+", Font, Brushes.White, OptionGlyphBounds, sf);
                    e.Graphics.DrawString("---", Font, Brushes.White, ButtonsSeparatorGlyphBounds, sf);
                }

                using (Pen p = new Pen(Color.Black))
                {
                    p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                    e.Graphics.DrawRectangle(p, designerSelectedBounds);
                }

                //e.Graphics.DrawString("Press ESC to Hide", Font, Brushes.Black, Width - 100f, 2f);
            }
        }