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
close icon

CurrencyTextBox with format say (0.00) sets the cursor on the extreme left

I have a CurrencyTextBox with format to display (0.00). On entering the CurrencyTextBox the cursor is put to the extreme left and when someone enters 1.22 for example using the keyboard the value of 10.22 gets put in. I used the SelectAllOnFocus property to true, this fixed the problem partly. However when someone enters the CurrencyTextBox and hits a delete and then enters the value of 1.22 we get 10.22 again. This however works when the user hits a backspace in the cell. I tried using the ProcessCmdKeys, KeyPress, KeyDown events to catch the delete key without success

CurrencyTextBox.zip

1 Reply

AR Anupama Roy Syncfusion Team October 31, 2005 01:43 PM UTC

Hi Arun, I am able to reproduce this problem in 3.3.0.0 also.However, we can derive from the CurrencyTextBox and handle its ProcessCmdKey method as shown below : public class CurrencyTextBoxCustom:Syncfusion.Windows.Forms.Tools.CurrencyTextBox { protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { if(msg.WParam.ToInt32() == (int) Keys.Delete ) { SendKeys.Send("{BackSpace}"); return true; } return base.ProcessCmdKey(ref msg, keyData); } } Please see the sample attached and let me know whether this helps you. Thanks for your interest in Syncfusion products, Regards, Anu.

CurrencyTextBox_sample.zip

Loader.
Live Chat Icon For mobile
Up arrow icon