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

Calculator Format and Focus

Hi,

I have to question about the Calculator control.

1. Number Format. How to display the value with commas for thousands, but show all the digits after decimal point. like, 1234.56789012 would show as 1,234.56789012

2. Say, place the calculator control and a Button control on a form,. after click the button, how to make the calculator control to continue receiving input from key pads? tried to set focus back, but no help.

Thanks,

Q

3 Replies

Administrator October 1, 2007 12:58 PM UTC

Hi Q,

Thank you for your interest in Syncfusion products.

Numeric format :
----------------

The calculator control by default does not allow the use of 'NumberGroupSeparator' like in DoubleTextBox. So to achieve this, we need to derive the CalculatorControl and override the 'CreateCalculatorDisplayBox' method.

Send focus back to Calculator :
--------------------------------

For this, please call focus method of calculator.

[C#]
CalculatorControl.Controls[0].Focus();

The below sample accomplishes the above changes. Please look at the attached sample and let me know if this meets your requirement.

http://websamples.syncfusion.com/samples/Tools.Windows/F68738/main.htm

Regards,
Jaya

QS Qingde Shi October 1, 2007 01:19 PM UTC

Hi Jaya,

Thanks.

The Controls[0].Focus() did the trick.

as for the format, number of decimal should be dynamic, I am not sure the method in your sample would work for all the cases.

Thanks again.

Q

Administrator December 26, 2007 05:09 AM UTC

Hi Q,

Please let me know if the above provided details helps you to resolve the issue and provide me more information in which cases it will not help that would help us to provide you a solution.

Regards,
Jaya

Loader.
Live Chat Icon For mobile
Up arrow icon