How to display an empty value in NumericUpDown control?

后端 未结 1 1246
臣服心动
臣服心动 2020-12-31 22:14

I have a Windows Forms application that includes NumericUpDown control With Minimum and Maximum values set to (50:80) accordingly an

相关标签:
1条回答
  • 2020-12-31 22:35

    You can't make default NumericUpDown control empty. NumericUpDown need a value to increase/decrease from. If 'empty' is only a matter of look empty when user see the form at first, then you can hack it by setting NumericUpDown's Text to empty:

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        NumericUpDown1.Text = ""
    End Sub
    

    With that NumericUpDown1 will look empty, but NumericUpDown1.Value is still 50.

    0 讨论(0)
提交回复
热议问题