Windows에서 고전적인 스타일의 렌더러를 제공하지 않습니다, 당신은거야 너 자신을 요리해야 해. SystemInformation 클래스를 사용하여 색상을 가져 오는 Color.FromKnownColor() 메트릭을 가져옵니다.
유일한 까다로운 부분은 프레임 단추가 잘 보이게하는 것입니다. 가장 좋은 방법은 직접 그리는 대신 글꼴의 글리프를 사용하는 것입니다. Webdings 글꼴은 이에 이상적입니다.
내 컴퓨터가 얼마나 일치하는지 확인할 수 없으며 컴퓨터가 Windows 8을 부팅하고 더 이상 클래식 스타일을 지원하지 않습니다. 완전히 추한하지
protected override void OnPaintBackground(PaintEventArgs e) {
base.OnPaintBackground(e);
var captionHeight = SystemInformation.CaptionHeight;
int border = SystemInformation.Border3DSize.Width;
var color1 = Color.FromKnownColor(activated ? KnownColor.ActiveCaption : KnownColor.InactiveCaption);
var color2 = Color.FromKnownColor(activated ? KnownColor.GradientActiveCaption : KnownColor.GradientInactiveCaption);
var captionrc = new Rectangle(0, 0, this.ClientSize.Width, captionHeight);
using (var brush = new LinearGradientBrush(captionrc, color1, color2, 0, false)) {
e.Graphics.FillRectangle(brush, captionrc);
}
int textx = border;
if (this.Icon != null) {
int height = SystemInformation.SmallIconSize.Height;
var iconrc = new Rectangle(border, (captionHeight - height)/2, height, height);
textx += height + border;
e.Graphics.DrawIcon(this.Icon, iconrc);
}
var color = Color.FromKnownColor(activated ? KnownColor.ActiveCaptionText : KnownColor.InactiveCaptionText);
using (var font = new Font(this.Font.FontFamily, SystemInformation.CaptionHeight - 4 * border, GraphicsUnit.Pixel)) {
TextRenderer.DrawText(e.Graphics, this.Text, font, new Point(textx, border), color);
}
using (var font = new Font(new FontFamily("Webdings"), captionHeight - 4 * border, GraphicsUnit.Pixel)) {
var glyphs = this.WindowState == FormWindowState.Maximized ? "\u0030\u0031\u0072" : "\u0030\u0031\u0072";
var width = TextRenderer.MeasureText(glyphs, font).Width;
TextRenderer.DrawText(e.Graphics, glyphs, font,
new Point(this.ClientSize.Width - width, border),
Color.FromKnownColor(KnownColor.WindowFrame));
}
}
내 컴퓨터에 다음과 같습니다 :

: 그렇지 않으면 당신은 아마이에 너무 많은 시간을 투자하지해야한다는 강한 힌트를 몇 가지 예제 코드를 :)