protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked) { DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo info = edit.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo; DevExpress.XtraEditors.Drawing.CheckEditPainter painter = edit.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter; DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args; info.EditValue = Checked; info.Bounds = r; info.CalcViewInfo(g); args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r); painter.Draw(args); args.Cache.Dispose(); }
protected void DrawCheckBox(Graphics g, Rectangle r, bool Checked, bool Grayed) { DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo info = default(DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo); DevExpress.XtraEditors.Drawing.CheckEditPainter painter = default(DevExpress.XtraEditors.Drawing.CheckEditPainter); DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs args = default(DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs); info = (DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo)_CheckEdit.CreateViewInfo(); painter = (DevExpress.XtraEditors.Drawing.CheckEditPainter)_CheckEdit.CreatePainter(); if (Grayed) { info.EditValue = _CheckEdit.ValueGrayed; } else { info.EditValue = Checked; } info.Bounds = r; info.CalcViewInfo(g); args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(g), r); painter.Draw(args); args.Cache.Dispose(); }