コード例 #1
0
        private void MetroToolTip_Draw(object sender, DrawToolTipEventArgs e)
        {
            MetroThemeStyle displayTheme = (Theme == MetroThemeStyle.Light)
                                               ? MetroThemeStyle.Dark
                                               : MetroThemeStyle.Light;

            Color backColor   = MetroPaint.BackColor.Form(displayTheme);
            Color borderColor = MetroPaint.BorderColor.Button.Normal(displayTheme);
            Color foreColor   = MetroPaint.ForeColor.Label.Normal(displayTheme);

            using (var b = new SolidBrush(backColor))
            {
                e.Graphics.FillRectangle(b, e.Bounds);
            }
            using (var p = new Pen(borderColor))
            {
                e.Graphics.DrawRectangle(p,
                                         new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height - 1));
            }

            Font f = MetroFonts.Default(13f);

            TextRenderer.DrawText(e.Graphics, e.ToolTipText, f, e.Bounds, foreColor,
                                  TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
        }
コード例 #2
0
        public MetroMonthCalendar()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.ResizeRedraw |
                     ControlStyles.SupportsTransparentBackColor, true);


            this.Font = MetroFonts.Default(12f);
            InitColors();
        }
コード例 #3
0
        public MetroPropertyGrid()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.ResizeRedraw |
                     ControlStyles.UserPaint |
                     ControlStyles.SupportsTransparentBackColor, true);


            this.Font = MetroFonts.Default(12f);
        }
コード例 #4
0
        // Token: 0x060000B3 RID: 179 RVA: 0x000040D8 File Offset: 0x000022D8
        private void MetroToolTip_Draw(object sender, DrawToolTipEventArgs e)
        {
            MetroThemeStyle theme     = (base.Theme == MetroThemeStyle.Light) ? MetroThemeStyle.Dark : MetroThemeStyle.Light;
            Color           color     = MetroPaint.BackColor.Form(theme);
            Color           color2    = MetroPaint.BorderColor.Button.Normal(theme);
            Color           foreColor = MetroPaint.ForeColor.Label.Normal(theme);

            using (SolidBrush solidBrush = new SolidBrush(color))
            {
                e.Graphics.FillRectangle(solidBrush, e.Bounds);
            }
            using (Pen pen = new Pen(color2))
            {
                e.Graphics.DrawRectangle(pen, new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height - 1));
            }
            Font font = MetroFonts.Default(13f);

            TextRenderer.DrawText(e.Graphics, e.ToolTipText, font, e.Bounds, foreColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
        }
コード例 #5
0
        private void MetroToolTip_Draw(object sender, DrawToolTipEventArgs e)
        {
            MetroThemeStyle metroThemeStyle = (this.Theme == MetroThemeStyle.Light ? MetroThemeStyle.Dark : MetroThemeStyle.Light);
            Color           color           = MetroPaint.BackColor.Form(metroThemeStyle);
            Color           color1          = MetroPaint.BorderColor.Button.Normal(metroThemeStyle);
            Color           color2          = MetroPaint.ForeColor.Label.Normal(metroThemeStyle);

            using (SolidBrush solidBrush = new SolidBrush(color))
            {
                e.Graphics.FillRectangle(solidBrush, e.Bounds);
            }
            using (Pen pen = new Pen(color1))
            {
                Graphics  graphics  = e.Graphics;
                int       x         = e.Bounds.X;
                int       y         = e.Bounds.Y;
                Rectangle bounds    = e.Bounds;
                Rectangle rectangle = e.Bounds;
                graphics.DrawRectangle(pen, new Rectangle(x, y, bounds.Width - 1, rectangle.Height - 1));
            }
            Font font = MetroFonts.Default(13f);

            TextRenderer.DrawText(e.Graphics, e.ToolTipText, font, e.Bounds, color2, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
        }