lixiaojun
2024-07-11 8d8cd298ab46aee191baf53ff320fd3290d1ec9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace IStation.WinFrmUI
{
    public static class TextEditExtend
    {
        /// <summary>
        /// 只能输入数字
        /// </summary> 
        public static void SetNumeric(this TextEdit txt)
        {
            txt.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            // txt.Properties.Mask.UseMaskAsDisplayFormat = true;
            txt.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
            txt.Text = string.Empty;
        }
 
 
 
    }
}