38 lines
1.0 KiB
C#

using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace DevComponents.DotNetBar.SuperGrid
{
///<summary>
/// CheckDisplay
///</summary>
static public class CheckDisplay
{
///<summary>
/// RenderCheckbox
///</summary>
///<param name="g"></param>
///<param name="bounds"></param>
///<param name="cstate"></param>
///<param name="bstate"></param>
static public void RenderCheckbox(
Graphics g, Rectangle bounds, CheckBoxState cstate, ButtonState bstate)
{
Size csize = CheckBoxRenderer.GetGlyphSize(g, cstate);
if (Application.RenderWithVisualStyles == true)
{
Point pt = bounds.Location;
pt.Y += (bounds.Height - csize.Height) / 2;
CheckBoxRenderer.DrawCheckBox(g, pt, cstate);
}
else
{
ControlPaint.DrawCheckBox(g, bounds, bstate);
}
}
}
}