winforms - problem in filtering textbox in windows application -


I need to enter the decimal value in my text box, if the user has signed in. The decimal value should not allow the other intelligent to leave this text box. If a user is not filed then he can allow any number to enter, which can restrict this pure NFForm textbox.

Decimal (1- 9), 3)

It can be any decimal value before the decimal place like

true matter

123 --- 1232.004 --- 123123123123.555--- 3123123123 --- .231 ---

A false case

123 .--- 222.33 --- 123.3 --- 21312323.1232133 --- .2 --- .12313 ---

incident of text box Subscribe to:

  Private Zero Text Box_Vilitating (Object Sender, CancelEventErgusE) {string text = ((text box) Sender). Text; String [] parts = text Split (new four [] {'.'}); Decimal dummy; E. Cancel = Decimal! Trace Para (Text, Outside Dummy) || ((Parts. Length == 2) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; }  

Or you can use text for valid or something else but the main idea is that if you can verify the verification on the text box, the user can not leave it by default Also check the property.


Comments