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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Double Text Box; override Subtract Key

Thread ID:

Created:

Updated:

Platform:

Replies:

79359 Feb 3,2009 07:23 PM UTC Feb 13,2009 06:07 AM UTC WinForms 1
loading
Tags: Tools
Sameer Khan
Asked On February 3, 2009 07:23 PM UTC

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.


Fathima Shalini P [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;