コード例 #1
0
        void DrawGroupBox(Graphics g)
        {
            // Get windows to draw the GroupBox
            Rectangle bounds = new Rectangle(ClientRectangle.X, ClientRectangle.Y + 6, ClientRectangle.Width, ClientRectangle.Height);

            GroupBoxRenderer.DrawGroupBox(g, bounds, Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled);

            // Text Formating positioning & Size
            StringFormat sf         = new StringFormat();
            int          i_textPos  = (bounds.X + 8) + m_toggleRect.Width + 2;
            int          i_textSize = (int)g.MeasureString(Text, this.Font).Width;

            i_textSize = i_textSize < 1 ? 1 : i_textSize;
            int i_endPos = i_textPos + i_textSize + 1;

            // draw a background rect for text
            Pen        rcPen   = new Pen(Brushes.Black);
            SolidBrush rcBrush = new SolidBrush(Color.FromArgb(180, 180, 180));
            Rectangle  titleRc = new Rectangle(bounds.X + 4, bounds.Y - 6, bounds.Width - 8, 12);

            g.FillRectangle(rcBrush, titleRc);
            g.DrawRectangle(rcPen, titleRc);

            // Draw the GroupBox text
            g.DrawString(Text, this.Font, Brushes.Black, i_textPos, 0);
        }
コード例 #2
0
        private void DrawGroupBox(Graphics g)
        {
            Rectangle clientRectangle = base.ClientRectangle;
            int       x = clientRectangle.X;

            clientRectangle = base.ClientRectangle;
            int y = clientRectangle.Y + 6;

            clientRectangle = base.ClientRectangle;
            int width = clientRectangle.Width;

            clientRectangle = base.ClientRectangle;
            Rectangle bounds = new Rectangle(x, y, width, clientRectangle.Height - 6);

            GroupBoxRenderer.DrawGroupBox(g, bounds, (GroupBoxState)(base.Enabled ? 1 : 2));
            StringFormat stringFormat = new StringFormat();
            int          num          = bounds.X + 8 + this.m_toggleRect.Width + 2;
            int          num2         = (int)g.MeasureString(this.Text, this.Font).Width;

            num2 = ((num2 < 1) ? 1 : num2);
            int num3 = num + num2 + 1;

            using (SolidBrush brush = new SolidBrush(this.BackColor))
            {
                g.FillRectangle(brush, 8, 2, num3 - 8, 12);
            }
            using (SolidBrush brush2 = new SolidBrush(this.ForeColor))
            {
                g.DrawString(this.Text, this.Font, brush2, (float)num, 0f);
            }
        }
コード例 #3
0
        void DrawGroupBox(Graphics g)
        {
            // Get windows to draw the GroupBox
            Rectangle bounds = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);

            GroupBoxRenderer.DrawGroupBox(g, bounds, String.Format("    {0}", Text), this.Font, Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled);
        }
コード例 #4
0
        //colors
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            GroupBoxRenderer.DrawParentBackground(e.Graphics, this.ClientRectangle, this);
            var rect = ClientRectangle;

            using (var path = GetRoundRectagle(this.ClientRectangle, Radious))
            {
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                rect = new Rectangle(0, 0,
                                     rect.Width, TitleFont.Height + Padding.Bottom + Padding.Top);
                if (this.BackColor != Color.Transparent)
                {
                    using (var brush = new SolidBrush(BackColor))
                        e.Graphics.FillPath(brush, path);
                }
                var clip = e.Graphics.ClipBounds;
                e.Graphics.SetClip(rect);
                using (var brush = new HatchBrush(TitleHatchStyle,
                                                  TitleBackColor, ControlPaint.Light(TitleBackColor)))
                    e.Graphics.FillPath(brush, path);
                using (var pen = new Pen(TitleBackColor, 1))
                    e.Graphics.DrawPath(pen, path);
                TextRenderer.DrawText(e.Graphics, Text, TitleFont, rect, TitleForeColor);
                e.Graphics.SetClip(clip);
                using (var pen = new Pen(TitleBackColor, 1))
                    e.Graphics.DrawPath(pen, path);
            }
        }
コード例 #5
0
ファイル: VaultPanel.cs プロジェクト: lvlvy/TQVaultAE
 /// <summary>
 /// Callback for the Paint event
 /// </summary>
 /// <param name="sender">sender object</param>
 /// <param name="e">PaintEventArgs data</param>
 public void PaintCallback(object sender, PaintEventArgs e)
 {
     if (this.DrawAsGroupBox)
     {
         GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle, this.Text, this.Font, System.Windows.Forms.VisualStyles.GroupBoxState.Normal);
     }
 }
コード例 #6
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            GroupBoxRenderer.DrawParentBackground(e.Graphics, this.ClientRectangle, this);
            var rect = ClientRectangle;

            using (var path = GetRoundRectagle(this.ClientRectangle, Radious))
            {
                e.Graphics.SmoothingMode      = SmoothingMode.AntiAlias;
                e.Graphics.InterpolationMode  = InterpolationMode.HighQualityBilinear;
                e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
                e.Graphics.TextRenderingHint  = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

                rect = new Rectangle(0, 0,
                                     rect.Width, TitleFont.Height + Padding.Bottom + Padding.Top);
                if (this.BackColor != Color.Transparent)
                {
                    using (var brush = new SolidBrush(BackColor))
                        e.Graphics.FillPath(brush, path);
                }
                var clip = e.Graphics.ClipBounds;
                e.Graphics.SetClip(rect);
                using (var brush = new SolidBrush(TitleBackColor))
                    e.Graphics.FillPath(brush, path);
                using (var pen = new Pen(TitleBackColor, 1))
                    e.Graphics.DrawPath(pen, path);
                TextRenderer.DrawText(e.Graphics, Text, TitleFont, rect, TitleForeColor);
                e.Graphics.SetClip(clip);
                using (var pen = new Pen(TitleBackColor, 1))
                    e.Graphics.DrawPath(pen, path);
            }
        }
コード例 #7
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
            Graphics g = pe.Graphics;

            GroupBoxRenderer.DrawGroupBox(g, ClientRectangle, "   " + this.Text, this.Font, this.ForeColor, TextFormatFlags.Left, GroupBoxState.Normal);
            CheckBoxRenderer.DrawCheckBox(g, ClientRectangle.Location, _CheckBoxBorderRectangle, "", null, TextFormatFlags.Left, _Focused, _CheckedState);
        }
コード例 #8
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (this.selfDrawn)
            {
                GroupBoxRenderer.DrawGroupBox(e.Graphics, new Rectangle(0, 0, Width, 1), GroupBoxState.Normal);
            }

            base.OnPaint(e);
        }
コード例 #9
0
ファイル: TextMixed.cs プロジェクト: Bormaglod/ComponentLib
 protected override void OnPaintBackground(PaintEventArgs pevent)
 {
     if (Application.RenderWithVisualStyles && transparentBackground)
     {
         GroupBoxRenderer.DrawParentBackground(pevent.Graphics, pevent.ClipRectangle, this);
     }
     else
     {
         Color backColor = palette.GetBackColor1(paletteBackground.Style, PaletteState.Normal);
         pevent.Graphics.FillRectangle(new SolidBrush(backColor), pevent.ClipRectangle);
     }
 }
コード例 #10
0
ファイル: CollapsibleGroupBox.cs プロジェクト: zparr/ATF
        /// <summary>
        /// Performs custom actions on paint event</summary>
        /// <param name="e">Paint event args</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            var rectangle = ClientRectangle;

            GroupBoxRenderer.DrawGroupBox(
                e.Graphics,
                rectangle,
                Text,
                Font,
                ForeColor,
                TextFormatFlags.Default,
                Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled);
        }
コード例 #11
0
        // Draw the group box in the current state.
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle,
                                          this.Text, this.Font, state);

            // Draw an additional inner border if visual styles are enabled.
            if (Application.RenderWithVisualStyles)
            {
                GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state);
            }
        }
コード例 #12
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            GroupBoxRenderer.DrawParentBackground(e.Graphics, this.ClientRectangle, this);
            var rect = ClientRectangle;

            SolidBrush backColorBrush = new SolidBrush(TitleBackColor);

            e.Graphics.FillRectangle(backColorBrush, 0, 0, this.Width, 18);
            backColorBrush.Dispose();

            TextRenderer.DrawText(e.Graphics, Text, TitleFont, new Point(2, 2), TitleForeColor);
            //ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, Color.SteelBlue, ButtonBorderStyle.None);
        }
コード例 #13
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     // draw gradient
     if (this.captionStyle == HighlightCaptionStyle.ForeStyle || this.captionStyle == HighlightCaptionStyle.HighlightStyle)
     { // HighlightCaptionStyle.HighlightStyle allways draw
         float _wPen = this.captionLineWidth * 2 + this.captionTextHeight;
         if (_wPen > 0)
         {
             using (Brush _gBrush = new LinearGradientBrush(new Point(0, 0), new Point(this.Width, 0), this.captionLineBeginColor, this.captionLineEndColor))
                 using (Pen _gPen = new Pen(_gBrush, _wPen))
                     e.Graphics.DrawLine(_gPen, 0, _wPen / 2, this.Width, _wPen / 2);
         }
     }
     else if (this.captionStyle == HighlightCaptionStyle.GroupBoxStyle)
     { // HighlightCaptionStyle.GroupBox draw GroupBox canvas
         string _capText = this.captionText;
         if (!string.IsNullOrEmpty(_capText))
         {
             _capText = _capText.Trim();
             if (!string.IsNullOrEmpty(_capText))
             {
                 _capText = string.Format(" {0} ", _capText);
             }
         }
         GroupBoxRenderer.DrawGroupBox(e.Graphics, this.ClientRectangle, _capText, this.Font, this.captionTextColor, this.Enabled ? System.Windows.Forms.VisualStyles.GroupBoxState.Normal : System.Windows.Forms.VisualStyles.GroupBoxState.Disabled);
     }
     else if (this.captionLineWidth > 0)
     {
         if (this.captionStyle != HighlightCaptionStyle.NavisionAxaptaStyle)
         { // HighlightCaptionMode.ForeColor | HighlightCaptionMode.HighlightColor
             using (Brush _gradientBrush = new LinearGradientBrush(new Point(0, 0), new Point(this.Width, 0), this.captionLineBeginColor, this.captionLineEndColor))
                 using (Pen _gradientPen = new Pen(_gradientBrush, this.captionLineWidth))
                     e.Graphics.DrawLine(_gradientPen, 0, this.captionTextHeight + this.captionLineWidth / 2, this.Width, this.captionTextHeight + this.captionLineWidth / 2);
         }
         else if (this.captionTextWidth + 1 < this.Width)
         { // HighlightCaptionMode.NavisionAxapta
             using (Brush _gradientBrush = new LinearGradientBrush(new Point(this.captionTextWidth, 0), new Point(this.Width, 0), this.captionLineBeginColor, this.captionLineEndColor))
                 using (Pen _gradientPen = new Pen(_gradientBrush, this.captionLineWidth > this.captionTextHeight ? this.captionTextHeight : this.captionLineWidth))
                     e.Graphics.DrawLine(_gradientPen, this.captionTextWidth, this.captionTextHeight / 2 + 1, this.Width, this.captionTextHeight / 2 + 1);
         }
     }
     // draw Text
     if (this.captionTextHeight > 0 && this.captionStyle != HighlightCaptionStyle.GroupBoxStyle)
     {
         using (Brush _textBrush = new SolidBrush(this.captionTextColor))
             e.Graphics.DrawString(this.captionText, this.Font, _textBrush, 0, this.captionStyle == HighlightCaptionStyle.HighlightStyle || this.captionStyle == HighlightCaptionStyle.ForeStyle ? this.CaptionLineWidth : 0);
     }
 }
コード例 #14
0
 protected override void OnPaintBackground(PaintEventArgs pevent)
 {
     if (Application.RenderWithVisualStyles)
     {
         GroupBoxRenderer.DrawParentBackground(pevent.Graphics, pevent.ClipRectangle, this);
     }
     else
     {
         // Fill default panel background color (TODO: this should be configurable)
         Color backColor = Palette.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal);
         using (SolidBrush backBrush = new SolidBrush(backColor))
         {
             pevent.Graphics.FillRectangle(backBrush, pevent.ClipRectangle);
         }
     }
 }
コード例 #15
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            GroupBoxRenderer.DrawParentBackground(e.Graphics, ClientRectangle, this);

            var rect = GetRectangle(ClientRectangle);

            using (var path = GetRoundRectagle(rect, Radious))
            {
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                if (BackColor != Color.Transparent)
                {
                    using (var brush = new SolidBrush(BackColor))
                        e.Graphics.FillPath(brush, path);
                }
                var clip = e.Graphics.ClipBounds;
                e.Graphics.SetClip(rect);
            }
        }
コード例 #16
0
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            base.OnPaintBackground(e);
            GroupBoxState state = this.Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled;

            if (string.IsNullOrWhiteSpace(base.Text))
            {
                GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), state);
            }
            else
            {
                if (LeftMode)
                {
                    GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), base.Text, this.headerFont, state);
                }
                else
                {
                    GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), base.Text, this.headerFont, TextFormatFlags.Right, state);
                }
            }
        }
コード例 #17
0
        void DrawGroupBox(Graphics g)
        {
            // Get windows to draw the GroupBox
            Rectangle bounds = new Rectangle(ClientRectangle.X, ClientRectangle.Y + 6, ClientRectangle.Width, ClientRectangle.Height - 6);

            GroupBoxRenderer.DrawGroupBox(g, bounds, Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled);

            // Text Formating positioning & Size
            StringFormat sf         = new StringFormat();
            int          i_textPos  = (bounds.X + 8) + m_toggleRect.Width + 2;
            int          i_textSize = (int)g.MeasureString(Text, this.Font).Width;

            i_textSize = i_textSize < 1 ? 1 : i_textSize;
            int i_endPos = i_textPos + i_textSize + 1;

            // Draw a line to cover the GroupBox border where the text will sit
            g.DrawLine(SystemPens.Control, i_textPos, bounds.Y, i_endPos, bounds.Y);

            // Draw the GroupBox text
            using (SolidBrush drawBrush = new SolidBrush(Color.FromArgb(0, 70, 213)))
                g.DrawString(Text, this.Font, drawBrush, i_textPos, 0);
        }
コード例 #18
0
 public static GraphicsPath CreateRounedGroupBoxControl(Graphics graphics, Control control, Rectangle rect, int radius, int border)
 {
     GroupBoxRenderer.DrawParentBackground(graphics, rect, control);
     return(CreateRounedRectangle(rect, radius, border));
 }
コード例 #19
0
ファイル: RendererTest.cs プロジェクト: wateras/winforms
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (comboBox1.SelectedItem == null)
            {
                return;
            }

            Graphics g = e.Graphics;
            Image    i = Image.FromFile(@"accessories-character-map.png");
            Font     f = new Font("Microsoft Sans Serif", 8);

            switch (comboBox1.SelectedItem.ToString())
            {
            case "ButtonRenderer":
                ButtonRenderer.DrawButton(g, new Rectangle(0, 125, 75, 23), System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(0, 25, 75, 23), System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(0, 50, 75, 23), System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(0, 75, 75, 23), System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(0, 100, 75, 23), System.Windows.Forms.VisualStyles.PushButtonState.Normal);

                ButtonRenderer.DrawButton(g, new Rectangle(100, 125, 75, 23), true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(100, 25, 75, 23), true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(100, 50, 75, 23), true, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(100, 75, 75, 23), true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(100, 100, 75, 23), true, System.Windows.Forms.VisualStyles.PushButtonState.Normal);


                ButtonRenderer.DrawButton(g, new Rectangle(200, 125, 75, 23), i, new Rectangle(200, 128, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(200, 25, 75, 23), i, new Rectangle(203, 28, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(200, 50, 75, 23), i, new Rectangle(203, 53, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(200, 75, 75, 23), i, new Rectangle(203, 78, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(200, 100, 75, 23), i, new Rectangle(203, 103, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Normal);


                ButtonRenderer.DrawButton(g, new Rectangle(300, 125, 75, 23), "Hi there button!", f, true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(300, 25, 75, 23), "Hi there button!", f, true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(300, 50, 75, 23), "Hi there button!", f, false, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(300, 75, 75, 23), "Hi there button!", f, true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(300, 100, 75, 23), "Hi there button!", f, false, System.Windows.Forms.VisualStyles.PushButtonState.Normal);

                ButtonRenderer.DrawButton(g, new Rectangle(400, 125, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(400, 25, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(400, 50, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, false, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(400, 75, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(400, 100, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, false, System.Windows.Forms.VisualStyles.PushButtonState.Normal);

                ButtonRenderer.DrawButton(g, new Rectangle(500, 125, 75, 23), "Hi there button!", f, i, new Rectangle(500, 128, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(500, 25, 75, 23), "Hi there button!", f, i, new Rectangle(500, 28, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(500, 50, 75, 23), "Hi there button!", f, i, new Rectangle(500, 53, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(500, 75, 75, 23), "Hi there button!", f, i, new Rectangle(500, 78, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(500, 100, 75, 23), "Hi there button!", f, i, new Rectangle(500, 103, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Normal);

                ButtonRenderer.DrawButton(g, new Rectangle(600, 125, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, i, new Rectangle(600, 128, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Pressed);
                ButtonRenderer.DrawButton(g, new Rectangle(600, 25, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, i, new Rectangle(600, 28, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Default);
                ButtonRenderer.DrawButton(g, new Rectangle(600, 50, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, i, new Rectangle(600, 53, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Disabled);
                ButtonRenderer.DrawButton(g, new Rectangle(600, 75, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, i, new Rectangle(600, 78, 16, 16), true, System.Windows.Forms.VisualStyles.PushButtonState.Hot);
                ButtonRenderer.DrawButton(g, new Rectangle(600, 100, 75, 23), "Hi there button!", f, TextFormatFlags.Left & TextFormatFlags.WordEllipsis, i, new Rectangle(600, 103, 16, 16), false, System.Windows.Forms.VisualStyles.PushButtonState.Normal);
                break;

            case "CheckBoxRenderer":
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 5), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 5, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 4, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.CheckedDisabled);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 25), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 25, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 24, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.CheckedHot);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 45), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 45, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 44, 16, 16), true, System.Windows.Forms.VisualStyles.CheckBoxState.CheckedNormal);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 65), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 65, 75, 14), "checkBox1", f, TextFormatFlags.Default, false, System.Windows.Forms.VisualStyles.CheckBoxState.CheckedPressed);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 85), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 85, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 84, 16, 16), true, System.Windows.Forms.VisualStyles.CheckBoxState.MixedDisabled);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 105), System.Windows.Forms.VisualStyles.CheckBoxState.MixedHot);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 125), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 125, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 124, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.MixedNormal);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 145), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 145, 75, 14), "checkBox1", f, i, new Rectangle(90, 144, 16, 16), true, System.Windows.Forms.VisualStyles.CheckBoxState.MixedPressed);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 165), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 165, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 164, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedDisabled);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 185), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 185, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 184, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedHot);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 205), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 205, 75, 14), "checkBox1", f, true, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal);
                CheckBoxRenderer.DrawCheckBox(g, new Point(5, 225), new Rectangle(8 + CheckBoxRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal).Width, 225, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 224, 16, 16), false, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedPressed);
                break;

            case "ComboBoxRenderer":
                if (!ComboBoxRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                ComboBoxRenderer.DrawTextBox(e.Graphics, new Rectangle(5, 5, 121, 21), System.Windows.Forms.VisualStyles.ComboBoxState.Normal);
                ComboBoxRenderer.DrawDropDownButton(e.Graphics, new Rectangle(109, 6, 16, 19), System.Windows.Forms.VisualStyles.ComboBoxState.Normal);
                ComboBoxRenderer.DrawTextBox(e.Graphics, new Rectangle(5, 35, 121, 21), this.Text, this.Font, System.Windows.Forms.VisualStyles.ComboBoxState.Hot);
                ComboBoxRenderer.DrawDropDownButton(e.Graphics, new Rectangle(109, 36, 16, 19), System.Windows.Forms.VisualStyles.ComboBoxState.Hot);
                ComboBoxRenderer.DrawTextBox(e.Graphics, new Rectangle(5, 65, 121, 21), this.Text, this.Font, new Rectangle(8, 65, 57, 21), System.Windows.Forms.VisualStyles.ComboBoxState.Disabled);
                ComboBoxRenderer.DrawDropDownButton(e.Graphics, new Rectangle(109, 66, 16, 19), System.Windows.Forms.VisualStyles.ComboBoxState.Disabled);
                ComboBoxRenderer.DrawTextBox(e.Graphics, new Rectangle(5, 95, 121, 21), this.Text, this.Font, TextFormatFlags.WordEllipsis, System.Windows.Forms.VisualStyles.ComboBoxState.Pressed);
                ComboBoxRenderer.DrawDropDownButton(e.Graphics, new Rectangle(109, 96, 16, 19), System.Windows.Forms.VisualStyles.ComboBoxState.Pressed);
                break;

            case "GroupBoxRenderer":
                Font f2 = new Font("Microsoft Sans Serif", 12);
                Font f3 = new Font("Microsoft Sans Serif", 14);
                Font f4 = new Font("Microsoft Sans Serif", 8);
                GroupBoxRenderer.DrawGroupBox(g, new Rectangle(5, 5, 150, 75), "My Group!", f, Color.Black, TextFormatFlags.Default, System.Windows.Forms.VisualStyles.GroupBoxState.Normal);
                GroupBoxRenderer.DrawGroupBox(g, new Rectangle(5, 105, 150, 75), "My Group!", f2, Color.Red, System.Windows.Forms.VisualStyles.GroupBoxState.Disabled);
                GroupBoxRenderer.DrawGroupBox(g, new Rectangle(5, 205, 150, 75), "My Group!", f3, TextFormatFlags.Default, System.Windows.Forms.VisualStyles.GroupBoxState.Normal);
                GroupBoxRenderer.DrawGroupBox(g, new Rectangle(5, 305, 150, 75), "My Group!", f4, System.Windows.Forms.VisualStyles.GroupBoxState.Disabled);
                GroupBoxRenderer.DrawGroupBox(g, new Rectangle(5, 405, 150, 75), System.Windows.Forms.VisualStyles.GroupBoxState.Normal);
                break;

            case "ProgressBarRenderer":
                if (!ProgressBarRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                g.DrawString("ChunkSpaceThickness: " + ProgressBarRenderer.ChunkSpaceThickness.ToString(), this.Font, Brushes.Black, 0, 0);
                g.DrawString("ChunkThickness: " + ProgressBarRenderer.ChunkThickness.ToString(), this.Font, Brushes.Black, 0, 20);

                ProgressBarRenderer.DrawHorizontalBar(g, new Rectangle(5, 40, 100, 20));
                ProgressBarRenderer.DrawHorizontalChunks(g, new Rectangle(7, 42, 47, 16));
                ProgressBarRenderer.DrawVerticalBar(g, new Rectangle(110, 40, 20, 100));
                ProgressBarRenderer.DrawVerticalChunks(g, new Rectangle(112, 42, 16, 47));
                break;

            case "RadioButtonRenderer":
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 5), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 5, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 4, 16, 16), false, System.Windows.Forms.VisualStyles.RadioButtonState.CheckedDisabled);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 25), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 25, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 24, 16, 16), false, System.Windows.Forms.VisualStyles.RadioButtonState.CheckedHot);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 45), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 45, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 44, 16, 16), true, System.Windows.Forms.VisualStyles.RadioButtonState.CheckedNormal);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 65), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 65, 75, 14), "checkBox1", f, TextFormatFlags.Default, false, System.Windows.Forms.VisualStyles.RadioButtonState.CheckedPressed);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 85), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 85, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 84, 16, 16), true, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedDisabled);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 105), System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedHot);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 125), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 125, 75, 14), "checkBox1", f, TextFormatFlags.Default, i, new Rectangle(90, 124, 16, 16), false, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal);
                RadioButtonRenderer.DrawRadioButton(g, new Point(5, 145), new Rectangle(8 + RadioButtonRenderer.GetGlyphSize(g, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedNormal).Width, 145, 75, 14), "checkBox1", f, i, new Rectangle(90, 144, 16, 16), true, System.Windows.Forms.VisualStyles.RadioButtonState.UncheckedPressed);
                break;

            case "ScrollBarRenderer":
                if (!ScrollBarRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(5, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.DownDisabled);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(25, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.DownHot);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(45, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.DownNormal);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(65, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.DownPressed);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(85, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.LeftDisabled);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(105, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.LeftHot);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(125, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.LeftNormal);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(145, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.LeftPressed);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(165, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.RightDisabled);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(185, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.RightHot);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(205, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.RightNormal);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(225, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.RightPressed);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(245, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.UpDisabled);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(265, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.UpHot);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(285, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.UpNormal);
                ScrollBarRenderer.DrawArrowButton(g, new Rectangle(305, 5, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState.UpPressed);

                ScrollBarRenderer.DrawHorizontalThumb(g, new Rectangle(5, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawHorizontalThumb(g, new Rectangle(45, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawHorizontalThumb(g, new Rectangle(85, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawHorizontalThumb(g, new Rectangle(125, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawHorizontalThumbGrip(g, new Rectangle(5, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawHorizontalThumbGrip(g, new Rectangle(45, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawHorizontalThumbGrip(g, new Rectangle(85, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawHorizontalThumbGrip(g, new Rectangle(125, 25, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawLeftHorizontalTrack(g, new Rectangle(5, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawLeftHorizontalTrack(g, new Rectangle(45, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawLeftHorizontalTrack(g, new Rectangle(85, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawLeftHorizontalTrack(g, new Rectangle(125, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawLowerVerticalTrack(g, new Rectangle(5, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawLowerVerticalTrack(g, new Rectangle(25, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawLowerVerticalTrack(g, new Rectangle(45, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawLowerVerticalTrack(g, new Rectangle(65, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawRightHorizontalTrack(g, new Rectangle(165, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawRightHorizontalTrack(g, new Rectangle(205, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawRightHorizontalTrack(g, new Rectangle(245, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawRightHorizontalTrack(g, new Rectangle(285, 45, 38, 18), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawSizeBox(g, new Rectangle(5, 105, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarSizeBoxState.LeftAlign);
                ScrollBarRenderer.DrawSizeBox(g, new Rectangle(25, 105, 18, 18), System.Windows.Forms.VisualStyles.ScrollBarSizeBoxState.RightAlign);

                ScrollBarRenderer.DrawUpperVerticalTrack(g, new Rectangle(85, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawUpperVerticalTrack(g, new Rectangle(105, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawUpperVerticalTrack(g, new Rectangle(125, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawUpperVerticalTrack(g, new Rectangle(145, 65, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawVerticalThumb(g, new Rectangle(5, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawVerticalThumb(g, new Rectangle(25, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawVerticalThumb(g, new Rectangle(45, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawVerticalThumb(g, new Rectangle(65, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                ScrollBarRenderer.DrawVerticalThumbGrip(g, new Rectangle(5, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Disabled);
                ScrollBarRenderer.DrawVerticalThumbGrip(g, new Rectangle(25, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Hot);
                ScrollBarRenderer.DrawVerticalThumbGrip(g, new Rectangle(45, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Normal);
                ScrollBarRenderer.DrawVerticalThumbGrip(g, new Rectangle(65, 105, 18, 38), System.Windows.Forms.VisualStyles.ScrollBarState.Pressed);

                g.DrawString(ScrollBarRenderer.GetSizeBoxSize(g, System.Windows.Forms.VisualStyles.ScrollBarState.Normal).ToString(), f, Brushes.Black, new PointF(5, 145));
                g.DrawString(ScrollBarRenderer.GetThumbGripSize(g, System.Windows.Forms.VisualStyles.ScrollBarState.Normal).ToString(), f, Brushes.Black, new PointF(5, 165));
                break;

            case "TabRenderer":
                if (!TabRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                TabRenderer.DrawTabPage(g, new Rectangle(5, 95, 700, 50));

                TabRenderer.DrawTabItem(g, new Rectangle(5, 55, 70, 25), System.Windows.Forms.VisualStyles.TabItemState.Normal);
                TabRenderer.DrawTabItem(g, new Rectangle(95, 55, 70, 25), true, System.Windows.Forms.VisualStyles.TabItemState.Selected);
                TabRenderer.DrawTabItem(g, new Rectangle(185, 55, 70, 25), "Tab 1", f, System.Windows.Forms.VisualStyles.TabItemState.Normal);
                TabRenderer.DrawTabItem(g, new Rectangle(275, 55, 70, 25), i, new Rectangle(278, 58, 16, 16), false, System.Windows.Forms.VisualStyles.TabItemState.Hot);
                TabRenderer.DrawTabItem(g, new Rectangle(365, 55, 70, 25), "Tab 6 is too long", f, true, System.Windows.Forms.VisualStyles.TabItemState.Normal);
                TabRenderer.DrawTabItem(g, new Rectangle(455, 55, 70, 25), "My Tab Octopus", f, TextFormatFlags.WordEllipsis, false, System.Windows.Forms.VisualStyles.TabItemState.Disabled);
                TabRenderer.DrawTabItem(g, new Rectangle(545, 55, 70, 25), "Tab 7", f, i, new Rectangle(546, 56, 16, 16), true, System.Windows.Forms.VisualStyles.TabItemState.Normal);
                TabRenderer.DrawTabItem(g, new Rectangle(635, 55, 70, 25), "Tab 8", f, TextFormatFlags.WordEllipsis, i, new Rectangle(638, 58, 16, 16), false, System.Windows.Forms.VisualStyles.TabItemState.Disabled);
                break;

            case "TextBoxRenderer":
                if (!TextBoxRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                TextBoxRenderer.DrawTextBox(g, new Rectangle(5, 55, 95, 40), System.Windows.Forms.VisualStyles.TextBoxState.Assist);
                TextBoxRenderer.DrawTextBox(g, new Rectangle(105, 55, 95, 40), "This is my text box text!!!", f, System.Windows.Forms.VisualStyles.TextBoxState.Disabled);
                TextBoxRenderer.DrawTextBox(g, new Rectangle(205, 55, 95, 40), "This is my text box text!!!", f, new Rectangle(205, 55, 95, 40), System.Windows.Forms.VisualStyles.TextBoxState.Hot);
                TextBoxRenderer.DrawTextBox(g, new Rectangle(305, 55, 95, 40), "This is my text box text!!!", f, TextFormatFlags.WordEllipsis, System.Windows.Forms.VisualStyles.TextBoxState.Normal);
                TextBoxRenderer.DrawTextBox(g, new Rectangle(405, 55, 95, 40), "This is my text box text!!!", f, new Rectangle(405, 55, 95, 40), TextFormatFlags.WordEllipsis, System.Windows.Forms.VisualStyles.TextBoxState.Readonly);
                TextBoxRenderer.DrawTextBox(g, new Rectangle(505, 55, 95, 40), System.Windows.Forms.VisualStyles.TextBoxState.Selected);
                break;

            case "TrackBarRenderer":
                if (!TrackBarRenderer.IsSupported)
                {
                    g.DrawString("Visual Styles not enabled", f, Brushes.Black, 0, 0);
                    break;
                }
                TrackBarRenderer.DrawBottomPointingThumb(g, new Rectangle(5, 5, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawBottomPointingThumb(g, new Rectangle(20, 5, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawBottomPointingThumb(g, new Rectangle(35, 5, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawBottomPointingThumb(g, new Rectangle(50, 5, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawHorizontalThumb(g, new Rectangle(5, 45, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawHorizontalThumb(g, new Rectangle(20, 45, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawHorizontalThumb(g, new Rectangle(35, 45, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawHorizontalThumb(g, new Rectangle(50, 45, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawHorizontalTicks(g, new Rectangle(5, 75, 100, 20), 15, System.Windows.Forms.VisualStyles.EdgeStyle.Bump);
                TrackBarRenderer.DrawHorizontalTicks(g, new Rectangle(115, 75, 100, 20), 10, System.Windows.Forms.VisualStyles.EdgeStyle.Etched);
                TrackBarRenderer.DrawHorizontalTicks(g, new Rectangle(225, 75, 100, 20), 5, System.Windows.Forms.VisualStyles.EdgeStyle.Raised);
                TrackBarRenderer.DrawHorizontalTicks(g, new Rectangle(335, 75, 100, 20), 25, System.Windows.Forms.VisualStyles.EdgeStyle.Sunken);

                TrackBarRenderer.DrawHorizontalTrack(g, new Rectangle(5, 120, 100, 20));

                TrackBarRenderer.DrawLeftPointingThumb(g, new Rectangle(5, 145, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawLeftPointingThumb(g, new Rectangle(25, 145, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawLeftPointingThumb(g, new Rectangle(45, 145, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawLeftPointingThumb(g, new Rectangle(65, 145, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawRightPointingThumb(g, new Rectangle(5, 165, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawRightPointingThumb(g, new Rectangle(25, 165, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawRightPointingThumb(g, new Rectangle(45, 165, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawRightPointingThumb(g, new Rectangle(65, 165, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawTopPointingThumb(g, new Rectangle(5, 185, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawTopPointingThumb(g, new Rectangle(20, 185, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawTopPointingThumb(g, new Rectangle(35, 185, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawTopPointingThumb(g, new Rectangle(50, 185, 12, 20), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawVerticalThumb(g, new Rectangle(5, 215, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled);
                TrackBarRenderer.DrawVerticalThumb(g, new Rectangle(25, 215, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot);
                TrackBarRenderer.DrawVerticalThumb(g, new Rectangle(45, 215, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal);
                TrackBarRenderer.DrawVerticalThumb(g, new Rectangle(65, 215, 20, 12), System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed);

                TrackBarRenderer.DrawVerticalTicks(g, new Rectangle(5, 230, 20, 100), 15, System.Windows.Forms.VisualStyles.EdgeStyle.Bump);
                TrackBarRenderer.DrawVerticalTicks(g, new Rectangle(50, 230, 20, 100), 10, System.Windows.Forms.VisualStyles.EdgeStyle.Etched);
                TrackBarRenderer.DrawVerticalTicks(g, new Rectangle(95, 230, 20, 100), 5, System.Windows.Forms.VisualStyles.EdgeStyle.Raised);
                TrackBarRenderer.DrawVerticalTicks(g, new Rectangle(140, 230, 20, 100), 25, System.Windows.Forms.VisualStyles.EdgeStyle.Sunken);

                TrackBarRenderer.DrawVerticalTrack(g, new Rectangle(185, 230, 20, 100));

                g.DrawString(TrackBarRenderer.GetBottomPointingThumbSize(g, System.Windows.Forms.VisualStyles.TrackBarThumbState.Normal).ToString(), f, Brushes.Black, new Point(5, 340));
                g.DrawString(TrackBarRenderer.GetLeftPointingThumbSize(g, System.Windows.Forms.VisualStyles.TrackBarThumbState.Hot).ToString(), f, Brushes.Black, new Point(5, 370));
                g.DrawString(TrackBarRenderer.GetRightPointingThumbSize(g, System.Windows.Forms.VisualStyles.TrackBarThumbState.Disabled).ToString(), f, Brushes.Black, new Point(5, 400));
                g.DrawString(TrackBarRenderer.GetTopPointingThumbSize(g, System.Windows.Forms.VisualStyles.TrackBarThumbState.Pressed).ToString(), f, Brushes.Black, new Point(5, 430));
                break;

            default:
                break;
            }
        }