How to Force only numeric values be allowed in maskedtextbox?

前端 未结 4 1645
栀梦
栀梦 2020-12-18 07:04

I am fairly new to Winforms, and I would like to know how to use a MaskedTextBox to ensure that only numerical values(decimals included) are entered by the user.

I

4条回答
  •  温柔的废话
    2020-12-18 07:33

    Why not just use a NumericUpDown? Set your max and min values, number of decimal places, and away you go.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown%28v=vs.90%29.aspx

提交回复
热议问题