组合框问题-Windows Vista/7 [英] Combobox Issue - Windows Vista/7

查看:83
本文介绍了组合框问题-Windows Vista/7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



Windows Vista和Windows 7中的Combobox.RightToLeft属性有一个奇怪的问题.

我有一个用于输入价格的组合框(即7.99)-由于各种原因,我已将此框设置为RightToLeft,但这是此例中需要的组合框.

问题是,当您键入"7.99"时,当您键入.''时,该点跳到文本的开头(因此它显示为".7"),但是如果您随后键入下一个数字,它会跳回到应有的位置(因此现在显示"7.9").

测试表明,这不仅是小数点,而且对于大多数非字母数字字符(例如,惊叹号和斜杠)也是如此.

还有其他人遇到过这种情况,并且知道解决方法吗?顺便说一句,它位于.NET 3.5中,我正在考虑在.NET 4中对其进行测试,以查看其功能是否相同.

最终,组合框仍然可以正常运行,但是很烦人,可能会使用户感到困惑.

亲切的问候.
马丁·戴维斯.

[原始问题标题= Combobox RightToLeft属性在Win Vista/7上移动字符...]

Hi all,



I have a strange problem with the Combobox.RightToLeft property in Windows Vista and Windows 7.

I have a combobox that is for inputting a price (i.e. 7.99) - this I have set to RightToLeft for various reasons, but it''s what is needed in this instance.

Problem is that when you type in ''7.99'', when you type ''.'', the point jumps to the beginning of the text (so it displays ''.7''), however if you then type the next number, it jumps back to where it should be (so now displays ''7.9'').

Testing shows that this isn''t just the decimal point, but to most non-alphanumeric characters such as exclaimation marks and slashes.

Has anyone else come across this, and know of a way to fix it? It''s in .NET 3.5 incidentally, I''m thinking of testing it out in .NET 4 to see if it does the same.

Ultimately, the comboboxes still function correctly, but it''s irritating and can be quite confusing to a user.

Kind Regards.
Martin Davies.

[Original Question Title = Combobox RightToLeft property moving characters around Win Vista/7...]

推荐答案

马丁,从右到左的属性是用于为RTL语言(如阿拉伯语)以从右到左的方式在控件中分配值.因此,当您在控件中编写了具有从右到左属性集的文本时,考虑到它是文本,最后一个值将到达第一个位置,您输入数字或十进制数字时,通常将其写为从左到右.因此,当您键入7时,请输入.".该点仍然是字符串形式的,因此它排在第一位,然后当您键入9时,即"7.9",它显然是一个十进制数字,因此点"又回到了需要的位置.
完全不是.NET问题.
Martin, Right to Left property is used to assign values in control in Right to Left fashion for RTL languages such as arabic.. So when you write any text in control with right to left property set, the last value comes to the first position considering it is a text, but when you write a number or decimal number it is universally written as Left to Right.. So when u type 7 then "." that dot is still consodered in string so it goes in first position and then when you type 9 ie "7.9" it is clearly a decimal number so the "dot" comes back to where it needs to.
Its not at all a .NET problem.


这篇关于组合框问题-Windows Vista/7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆