Replies: 1 comment
-
最近刚学习wpf,也碰到了这个问题。看了一下代码,应该是这么回事。 public override FrameworkElement CreateElement(PropertyItem propertyItem) => new NumericUpDown
{
IsReadOnly = propertyItem.IsReadOnly,
DecimalPlaces = 2,
Increment = 0.01,
Minimum = Minimum,
Maximum = Maximum
}; 这里我是设置成了保留两位小数,每个增量为0.01。不过这样改了以后所有的数值编辑框全部都变成了两位小数,反正是能用了。各位大佬如果有更好的办法,帮忙解答一下。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PropertyGrid控件绑定的对象中有double类型属性时, 控件无法输入小数点。以及float类型属性显示异常 如0.5 显示为0.5000000154这样


Beta Was this translation helpful? Give feedback.
All reactions