All,
Does anyone know how to format the numbers displayed on a NumericUpDown control? I have two NumericUpDown controls on a form. One representing Hour and the other Minute. I want them to display a leading "0" if the hour or minute is < 10.
Display like "02" or "07".
Anyone???
TIA
Ken - KC7RAD
Loading
Mike GoldPosted Feb 21, 2007, 8:04 PM
(2) Choose add Custom Control
(3) Change the base class from Control to NumericUpDown
(4) override UpdateEditText with the following code:
protected override void UpdateEditText()
{
this.Text = Value.ToString("00");
// base.UpdateEditText();
}
(5) Compile
(6) Drag the new custom control from your toolbox to your form
-Mike G