I'm a very low-level amateur - sorry if this is really basic (pun intended).
I have a numeric up down box that I wish to auto size the width, but autosize doesn't seem to do anything. Using VS Community. Here is some demonstration code of the problem (not the real code I'm using, but same behavior). The box just stays the same size. Shouldn't the box shrink and grow with the length of the number? Or am I misinterpreting what autosize does?
I have a numeric up down box that I wish to auto size the width, but autosize doesn't seem to do anything. Using VS Community. Here is some demonstration code of the problem (not the real code I'm using, but same behavior). The box just stays the same size. Shouldn't the box shrink and grow with the length of the number? Or am I misinterpreting what autosize does?
Code:
' ------- VB.net code -----------------
Public Class Form1
Dim x As ULong
Dim y As ULong
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
nubAutosize.AutoSize = True
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Application.DoEvents()
nubAutosize.Value = 1
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 10
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 1000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 10000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 100000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 1000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 10000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 100000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 1000000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 10000000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 100000000000
For y = 1 To 100000
Application.DoEvents()
Next
nubAutosize.Value = 1000000000000
For y = 1 To 100000
Application.DoEvents()
Next
End Sub
End Class