我有一个正在翻译成中文的Winforms应用程序.我有一个数字文本框,用于使用正则表达式验证输入.当用户使用IME输入文本时,数字似乎不会以数字形式出现.
I've got a Winforms application that I am in the process of translating into Chinese. I've got a numeric text box that validates the input with a regular expression. When the user is entering text with IME, numeric digits don't seem to come in as numeric digits.
关于可能的解决方法,我发现将文本框的ImeMode属性设置为关闭".在我的测试中,这可以使所有内容正确无误,但是我对IME并没有太多的经验.
On possible work around I have found is to set the ImeMode property of the text box to 'Off'. In my testing, this makes everything correctly, but I don't have a ton of experiance with IMEs.
将ImeMode设置为Off有什么负面影响?我应该不惜一切代价避免这种情况吗?或者,如果用户只能输入数字,那还可以吗?
What are the negative impacts of setting the ImeMode to Off? Is this something I should avoid at all costs or is it ok if the only things the user can enter are numbers?
推荐答案根据 MSDN文档,可以为数字字段关闭IME.
According to the MSDN documentation, it is OK to turn off the IME for a numeric field.
IME是使用户能够使用的程序 输入复杂的字符并 符号,例如日语汉字 字符,使用标准键盘. 通常设置ImeMode属性 到ImeMode.Off以获取TextBox控件 只能输入数字 值.
An IME is a program that enables users to enter complex characters and symbols, such as Japanese Kanji characters, using a standard keyboard. The ImeMode property is typically set to ImeMode.Off for a TextBox control that is intended to only enter numeric values.
更多推荐
将ImeMode设置为Off有什么负面影响
发布评论