如何在C#中显示NumericUpDown中的"001“而不是"1”

xingyun86 4小时前 15

直接重写即可实现:

public class MyNumericUpDown : NumericUpDown
{
    protected override void UpdateEditText()
    {
        this.Text = this.Value.ToString().PadLeft(3, '0');//或string.Format("{0:D3}",Convert.ToInt32(this.Value));
    }    
}

×
打赏作者
最新回复 (0)
查看全部
全部楼主
返回