There's no such functionality built into the standard control. However, it's fairly easy added by creating a custom control that inherits from the NumericUpDown
class and overrides the UpdateEditText
method to format the number accordingly.
For example, you might have the following class definition:
public class NumericUpDownEx : NumericUpDown
{
public NumericUpDownEx()
{
}
protected override void UpdateEditText()
{
// Append the units to the end of the numeric value
this.Text = this.Value + " uA";
}
}
Or, for a more complete implementation, see this sample project: NumericUpDown with unit measure
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…