Numeric TextBox

后端 未结 13 1120
再見小時候
再見小時候 2020-12-03 20:01

Im new to programming and I dont know very much about but I\'m making a calculator, and i want to use a textbox that only acepts numbers and decimals, and when the user past

13条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 20:26

            if ("1234567890".IndexOf(e.KeyChar.ToString()) > 0)
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
    

提交回复
热议问题