⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 numerictextbox.cs

📁 Fireball.CodeEditor is an source code editor control derived from the best compona SyntaxBox Control
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Fireball.Windows.Forms
{
    public class NumericTextBox:TextBox
    {
        private const int WM_PASTE = 0x302;
        private NumericBox _owner;

        internal NumericTextBox(NumericBox owner)
        {
            _owner = owner;
        }

        protected override void WndProc(ref Message m)
        {

            if (m.Msg == WM_PASTE)
            {
                string clipBoard = (string)Clipboard.GetData(System.Windows.Forms.DataFormats.Text);
                clipBoard = _owner.ParseInputString(clipBoard);
                if (this.SelectedText.Length > 0)
                {
                    this.SelectedText = clipBoard;
                }
                else
                {
                    this.AppendText(clipBoard);
                }

                return;
            }

            base.WndProc(ref m);
        }

        protected override void OnTextChanged(EventArgs e)
        {
            base.OnTextChanged(e);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -