Hi,
as a french user, I would like to be able to choose if I want, or not, to accept dots from the numeric pad.
3.14 and 3,14 is the same for us so is there anything to do about it ?
Thanks,
Hi,
as a french user, I would like to be able to choose if I want, or not, to accept dots from the numeric pad.
3.14 and 3,14 is the same for us so is there anything to do about it ?
Thanks,
Hi Antoine,
If your Windows region settings for number format are set to use comma as a decimal symbol, are decimal numbers showing up with the comma properly for you? They seem to be working right here.
Or are you specifically referring to the number pad's key next to the zero key inserting a comma instead of dot in this scenario? I didn't see Notepad inserting a comma when I had the comma decimal symbol set and I pressed that key. Do any other apps do that?
Hi !
Yes it's the number pad's key next to the zero key that is inserting a dot and I just want any ActiPro editor to accept it.
Excel for instance convert it to a coma so it accepts it. And you're right notepad keep it as a dot.
So should I write my own code to workaround that ?
Hi Antoine,
I also looked at Word and they have it come through as a dot, like Notepad.
Yes you would probably have to handle that yourself somehow. Since we have a regular WPF TextBox in the edit box that takes the input, the typing of the character is a bit out of our hands. We just see that a "." character gets composed by WPF's text composition, but aren't told that it comes from that particular decimal key. You might have to block like a KeyDown event for that key to block the text from getting composed how it is currently.
Hi !
Okay and in another way, could it be possible to accept dots as decimal separator ? Your textboxes higlight in red and don't accept a value with a dot (3.14 for instance) Is there a way to remove it ? I want to accept either dots and comas.
Hello,
Can you tell me exactly how to reproduce the red highlights that you mentioned in one of our samples? I'm not seeing that in our v2018.1 samples for DoubleEditBox.
Hi,
it's quite simple, just type some decimal number using the number pad's key next to the zero key as the decimal separator and it will trigger the red error thing.
I reproduced it with your 2018.1 version.
Hi Antoine,
I've tried that but never see the red box you mention. I'm trying to get more information on which sample of ours you are using. I have French number format on my system and I tried the Double Edit Box QuickStart. Then I typed a decumal number in with the keypad. But I never saw red, and as I tabbed off the control, it restored another value. Pressing Enter after typing a decimal value never committed the value due to the decimal point.
One thought is that the DoubleEditBox has its InputScopeNameValue property set to Number. That value gets converted and set to the TextBox.InputScope property on the TextBox in the edit box's template. Perhaps something within Microsoft's TextBox logic is activating this red box you see, and changing that property would help. I'm still not sure why I don't see a red box though.
Hi,
We finally choose to create a custom editor and to handle this key.
if (e.Key == Key.Decimal)
{
TextBox txb = sender as TextBox;
int caretPos = txb.CaretIndex;
txb.Text = txb.Text.Insert(txb.CaretIndex,
CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator);
txb.CaretIndex = caretPos + 1;
e.Handled = true;
}
else
{
OnKeyDown(e);
}
Please log in to a validated account to post comments.