private void DrawCaptionButton(Graphics g, ref Rectangle rc,
CaptionButton button, ButtonState state)
{
ControlPaint.DrawCaptionButton(g, rc, button, state);
g.DrawString(state.ToString() + ", " + button.ToString(), Font,
Brushes.Black, rc.Width + 5, rc.Y + (rc.Height -
Font.Height) / 2);
rc.Offset(0, rc.Height + 5);
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Rectangle rc = new Rectangle(0, 0, 25, 25);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Close,
ButtonState.All);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Help,
ButtonState.Checked);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Maximize,
ButtonState.Flat);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Minimize,
ButtonState.Inactive);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Restore,
ButtonState.Normal);
DrawCaptionButton(e.Graphics, ref rc, CaptionButton.Close,
ButtonState.Pushed);
}
منبع : http://www.amazon.com/GDI-Custom-Con.../dp/1904811604