I have a Winforms Application, in which I have a Combo Box, and a text box. Combo box has Currency symbols as follows:
USD
GBP
CAD
AUD
JPY
EUR
ISK
PLZ
TRL
etc ..
The user first selects one currency symbol from the above, and then types in a value in a text box, such as, $32.50
, etc ..
I need to validate the string that he types into the text box, based on the currency he selected in the Combo Box. Each currency has its own way of writing money values.
For example, if the user selects USD
then all of these typed strings shouble be reported as valid:
223.3
2244.44
$3,754.24
However if the user selects TRL
(Turkish Lira), in which symbol is placed after the numeric value (to its right), then these should be valid:
223.3
2244.44
3,754.24 TL
How can I achieve this kind of validation ?