form1.cs

来自「windows mobile ,edit过滤数字控件」· CS 代码 · 共 60 行

CS
60
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DemoApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void numDecimalPlaces_ValueChanged(object sender, EventArgs e)
        {
            numericUpDown1.DecimalPlaces = Convert.ToInt32(numDecimalPlaces.Value);
        }
        private void menuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        private void numMin_ValueChanged(object sender, EventArgs e)
        {
            numericUpDown1.Minimum = Convert.ToInt32(numMin.Value);
        }
        private void numMax_ValueChanged(object sender, EventArgs e)
        {
            numericUpDown1.Maximum = Convert.ToInt32(numMax.Value);
        }
        private void chkEnforceMinMax_CheckStateChanged(object sender, EventArgs e)
        {
            numericUpDown1.EnforceMinMax = numMin.Enabled = numMax.Enabled = chkEnforceMinMax.Checked;
        }
        private void Form1_Closed(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void numericUpDown1_GotFocus(object sender, EventArgs e)
        {
            Debug.WriteLine("numericUpDown1_GotFocus");
        }
        private void numericUpDown1_LostFocus(object sender, EventArgs e)
        {
            Debug.WriteLine("numericUpDown1_LostFocus");
        }
        private void numericUpDown1_Validating(object sender, CancelEventArgs e)
        {
            Debug.WriteLine("numericUpDown1_Validating");
        }
        private void numericUpDown1_Validated(object sender, EventArgs e)
        {
            Debug.WriteLine("numericUpDown1_Validated");
        }
    }
}

⌨️ 快捷键说明

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