如何获取在 numericupdown silverlight 控件中输入的字符串值?
我正在使用银光数字上下控制。控件设置为十进制数。
最大限制为 28,最小限制为 -28
增量步长为 0.25
在荷兰文化中使用此控件,因此它接受 1,2 形式的值
并将其转换为 1.2
3 ,5 并将其转换为 3.5
10,3 并将其转换为 10.3
27,5 并将其转换为 27.5
现在我的问题是,当尝试输入值
1.2,它会将其转换为 12,00(我希望 1.2 应该反映为 1,2)
我如何实现它?
或如何获取在 NumeriCupDown 控件中输入的字符串值作为字符串。
这样我就可以按照我想要的方式对字符串进行操作?
我尝试使用事件
private void NumericUpDown_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
}
但对我没有多大帮助。
请找到附图,在非公共成员中,我正在获取 NumericUpDown 控件的 Text 属性,但无法在我的代码中实现该属性,如何获取该 TEXT 属性。
I am using silver-light numeric up-down control. Control is set for decimal numbers.
Maximum limit 28 and minimum limit is -28
Increment steps are 0.25
using this control in dutch culture so it accept value in the form
1,2 and converts it in to 1.2
3,5 and converts it in to 3.5
10,3 and converts it in to 10.3
27,5 and converts it in to 27.5
Now my issue is that when try to enter value
1.2 it converts it into 12,00 (I want 1.2 should reflect to 1,2)
How do I achieve it?
or How do I get string value entered in the NumeriCupDown control as string.
so I can act on string as I want?
I tried using event
private void NumericUpDown_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
}
but does not help me lot.
Please find attached image where in Non Public member i am getting Text Property of NumericUpDown control but not able to implement that in my code how do i Get that TEXT property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建 NumericUpDown 的子类并重写 ParseValue 方法:
Create a subclass of NumericUpDown and override the ParseValue method: