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

📄 edit_widget.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Pc.BizControls
{
    using System;
    using System.Windows.Forms;

    public class edit_widget : TextBox
    {
        private bool m_fIsNumber;

        protected bool is_valid_char(char c)
        {
            return ((this.Multiline && (('\n' == c) || ('\r' == c))) || (!this.is_number || (('0' <= c) && ('8' >= c))));
        }

        protected bool is_valid_text(string text)
        {
            foreach (char ch in text)
            {
                if (!this.is_valid_char(ch))
                {
                    return false;
                }
            }
            return true;
        }

        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);
            int windowLong = (int) win32api_wrapper.GetWindowLong(base.Handle, -16);
            if (this.m_fIsNumber)
            {
                windowLong |= 0x2000;
            }
            else
            {
                windowLong &= -8193;
            }
            win32api_wrapper.SetWindowLong(base.Handle, -16, (IntPtr) windowLong);
        }

        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);
        }

        protected override void WndProc(ref Message m)
        {
            int msg = m.Msg;
            base.WndProc(ref m);
        }

        public bool is_number
        {
            get
            {
                IntPtr handle = base.Handle;
                int windowLong = (int) win32api_wrapper.GetWindowLong(base.Handle, -16);
                this.m_fIsNumber = 0x2000 == (0x2000 & windowLong);
                return this.m_fIsNumber;
            }
            set
            {
                this.m_fIsNumber = value;
                IntPtr handle = base.Handle;
                int windowLong = (int) win32api_wrapper.GetWindowLong(base.Handle, -16);
                if (this.m_fIsNumber)
                {
                    windowLong |= 0x2000;
                }
                else
                {
                    windowLong &= -8193;
                }
                win32api_wrapper.SetWindowLong(base.Handle, -16, (IntPtr) windowLong);
            }
        }
    }
}

⌨️ 快捷键说明

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