C# Generics : how to use x.MaxValue / x.MinValue (int, float, double) in a generic class

前端 未结 4 1766
天涯浪人
天涯浪人 2021-01-05 03:59

I\'m using the WPF Extended Toolkit ( http://wpftoolkit.codeplex.com/ ).

It has a nice NumericUpDown control that I\'d like to use, but internally it uses doubles -

4条回答
  •  囚心锁ツ
    2021-01-05 04:38

    You should get the latest source code for the Extended WPF Toolkit. The updated NumericUpDown control allows you to specify what data type to use in the editor. The following code specifies to use an Int32 as the data type instead of the default double. As you can see this is done by setting the ValueType property on the NumericUpDown control.

     
    

提交回复
热议问题