Source/Editors/VisualCheckBox.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using DevComponents.DotNetBar.Rendering;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace DevComponents.Editors
{
    public class VisualCheckBox : VisualToggleButton
    {
        #region Private Variables
        private Size _DefaultSize = new Size(13, 13);
        #endregion

        #region Events
        #endregion

        #region Constructor
        #endregion

        #region Internal Implementation
        public override void PerformLayout(PaintInfo pi)
        {
            this.Size = new System.Drawing.Size(_DefaultSize.Width + 2, _DefaultSize.Height);
            base.PerformLayout(pi);
        }

        protected override void OnPaint(PaintInfo p)
        {
            Graphics g = p.Graphics;
            Rectangle r = new Rectangle(RenderBounds.X + 1, RenderBounds.Y + (RenderBounds.Height - _DefaultSize.Height) / 2,
                _DefaultSize.Width, _DefaultSize.Height);


            Office2007CheckBoxItemPainter painter = PainterFactory.CreateCheckBoxItemPainter(null);
            Office2007CheckBoxColorTable ctt = GetCheckBoxColorTable();
            Office2007CheckBoxStateColorTable ct = ctt.Default;
            if (!this.GetIsEnabled(p))
                ct = ctt.Disabled;
            else if (this.IsMouseDown)
                ct = ctt.Pressed;
            else if (this.IsMouseOver)
                ct = ctt.MouseOver;

            painter.PaintCheckBox(g, r,
                ct, this.Checked ? CheckState.Checked : CheckState.Unchecked);

            base.OnPaint(p);
        }

        private Office2007CheckBoxColorTable GetCheckBoxColorTable()
        {
            Office2007Renderer r = this.GetRenderer() as Office2007Renderer;
            if (r != null)
            {
                return r.ColorTable.CheckBoxItem;
            }
后面还有 15 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。