We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Double Text Box; override Subtract Key

I am using a double text box; which works fine.

Except our users find the "-" key handling very confusing.

I want to override the HandleSubtractKey() function such that the "-" sign would behave like it behaves for regular text boxes.

Any idea how to do that; I tried to return a fake NumberModifyState object; but that didnt work.

Essentially; I do not want to call base.HandleSubtractKey().

Would appreciate any help.


1 Reply

FS Fathima Shalini P Syncfusion Team February 13, 2009 06:07 AM UTC

Hi Sameer,

Thank you for your interest in Syncfusion Products.

We can customize the negative values of the DoubleTextBox using various properties. Please refer to the below code that displays the negative values in black color and displays the negative sign at the end of the number value.


this.doubleTextBox1.NumberNegativePattern = 4;
this.doubleTextBox1.NegativeColor = Color.Black;


TextBox control appends the special characters in between the numbers when we type since it takes the numbers and special characters as text. The DoubleTextBox is a text box-derived control that can display double data type values only. So we can only display the negative sign before or after the number. So changing the format for displaying the negative values can be performed using NumberNegativePattern property. Please refer to the below KB for more details:

http://www.syncfusion.com/support/kb/tools/Default.aspx?ToDo=view&questId=119

Note:

We can also change the NegativeSign of the DoubleTextBox as described below:

this.doubleTextBox1.NegativeSign = "#";

If I have misunderstood your requirement, could you please explain me your requirement in detail so that I could provide you a better solution at the earliest?

Please let me know if any concerns.

Regards,
Fathima


Loader.
Live Chat Icon For mobile
Up arrow icon