When the focus is in a NumericEditor text box and the user press F4 key for example, the calculator is shown. After the user enters a value in the calculaor, for example after calculation, the user may either press OK button or the Cancel button in the calculator. What events or triggers should we catch so we can know that the user has pressed the OK button and then add the calculator text in the editor, or if it is a cancel button do nothing.
koolmike90 said:I looked at the UltraCalculatorDropDown and found out that it had its own text box, and so pressing ok would put the text in that editor. But, our requirement is different. We are inhereting the NumericTextBox and then adding the drop down calculator as a invisible control. We want to transfer the text inside the caculator editor to another text box.
Oh, okay. That was not at all clear from your original post - especially since the title of this post mentioned UltraCalculatorDropDown. :)
If you are using UltraNumericEditor with an EditorDropDownButton, then it's up to you to handle the click event of the OK button and update the Value of the UltraNumericEditor yourself.
I solved the problem. Thanks!
Hi Mike,
I looked at the UltraCalculatorDropDown and found out that it had its own text box, and so pressing ok would put the text in that editor. But, our requirement is different. We are inhereting the NumericTextBox and then adding the drop down calculator as a invisible control. We want to transfer the text inside the caculator editor to another text box.
That could be true if the NumericEditor is attached, bound, to the calculator. But how do we tell the Numeric text box that use that calculator? I did not see any binding.
But also our case is different and I wonder if this case is solved using the method you mentioned.
Our case:
We inherit a control from UltraNumerciEditor and then inherit many other controls from that control. Then in the first control, we show the calculator, using its Show() method, if the user presses F4 But after dismissing the calcultor, nothing happens, even if the user presses OK. Note that the calculator is not bound with any control, we only refer to it, by instantiating it.
Class Structures:
class A: UltraNumerc
{
//If the user press F4, we handle the key and show the calculator, using its show method, and then after AfterCloseUp event is raised, we use Hide()
}
///We add these controls on the form, and if the end-user presses F4 the calculator is shown, but how to get the text ?
class B: class A
class C:class A
{}
If the user clicks okay, the value is automatically transferred to the text portion of the control. You don't have to handle an event or write code to do this.