Source/Editors/VisualNumericInput.cs

(开头部分) 6KB

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

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

namespace DevComponents.Editors
{
    public class VisualNumericInput : VisualInputBase
    {
        #region Private Variables
        #endregion

        #region Events
        /// <summary>
        /// Occurs when Value property has changed.
        /// </summary>
        public event EventHandler ValueChanged;
        #endregion

        #region Constructor
        #endregion

        #region Internal Implementation
        protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Subtract || e.KeyCode == System.Windows.Forms.Keys.OemMinus) && AllowsNegativeValue)
            {
                if (!this.IsEmpty)
                    NegateValue();
                e.Handled = true;
            }

            base.OnKeyDown(e);
        }

        protected override bool OnCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
        {
            if (!this.IsReadOnly)
            {
                if (keyData == System.Windows.Forms.Keys.Up)
                {
                    IncreaseValue();
                    return true;
                }
                else if (keyData == System.Windows.Forms.Keys.Down)
                {
                    DecreaseValue();
                    return true;
                }
            }
            return base.OnCmdKey(ref msg, keyData);
        }

        protected override void OnMouseWheel(System.Windows.Forms.MouseEventArgs e)
        {
            if (!this.IsReadOnly)
            {
                if (e.Delta > 0)
后面还有 146 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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