Checking for numeric value entered in text box in Visual Basic

前端 未结 6 1256
醉酒成梦
醉酒成梦 2021-01-18 19:21

I am working on a program for my Visual Basic class and have a quick question. One of the things we were encouraged to do was to check to make sure the quantity entered in a

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-18 19:51

    Yes, Double.Tryparse is the best answer to this question, but to save you time on coding and ensure that the value entered is always numeric, use the NumericDropdown control instead of the plain Text Box so that you are sure that inputted value is always numeric and save you time checking the inputted value since that control will not accept anything but numeric values only.

提交回复
热议问题