Results 1 to 9 of 9

Thread: Numeric Up Down Autosize not changing size

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    13

    Numeric Up Down Autosize not changing size

    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?

    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
    Last edited by si_the_geek; Sep 1st, 2021 at 02:53 AM. Reason: added Code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width