The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Is there a way to prevent negative values from being entered into this control? I have need of a numeric textbox that cannot allow a negative value. I can convert the value back to positive inside the TextChanged event, but the CurrencyNegativePattern is still adding the formatting for a negative value. Any ideas?
DJDavis Jebaraj Syncfusion Team March 14, 2003 05:48 PM UTC
Hi,
The CurrencyTextBox control does not provide a property or method to prevent non negative values. This can be achieved by deriving from the CurrencyTextBox control and overriding ProcessCmdKey and Text property. I have attached a sample to this message that shows this method.
Regards,
Davis
JHJamie HillMarch 19, 2003 02:46 PM UTC
That works great. Thank you very much.
JHJamie HillMarch 24, 2003 06:57 PM UTC
I also found a workaround for this. You can change the negative color to be the same as the positive color, set the CurrencyNegativePattern to 1, and set the NegativeSign property to nothing and it will not change any formatting when negative values are entered.