Control renderer Demo: CheckBox
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
public class Form1 : Form
{
public Form1() {
InitializeComponent();
}
private void ControlRenderer_Paint(object sender, PaintEventArgs e)
{
CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(10,10),
new Rectangle(10,10,110,15), "Style checkbox", Font,false, CheckBoxState.CheckedNormal);
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// ControlRenderer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "ControlRenderer";
this.Text = "ControlRenderer";
this.Paint += new System.Windows.Forms.PaintEventHandler(this.ControlRenderer_Paint);
this.ResumeLayout(false);
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
}
Related examples in the same category