none
NumericUpDown Size

    Question

  • Hi All,

    I have a numericUpDown control on a windows form.

    The user would like the arrows to be larger. I cannot seem to get that to happen.

    Does anyone know how to increase the size of the up/down arrows?

    Thanks

    Jeff

    Thursday, August 31, 2006 4:27 PM

Answers

  • I don't know -and i don't think there is- a way to increase arrow size. One plain solution is to increase font size which will let you have bigger arrow size but also larger font size. Other way is to use a text box and two buttons and set properties as followed .

    'Initialization As Followed -----------------------------------------------------

    Me.txtNumericUpDown = New System.Windows.Forms.TextBox

    Me.bUp = New System.Windows.Forms.Button

    Me.bDwn = New System.Windows.Forms.Button

    '

    'txtNumericUpDown

    '

    Me.txtNumericUpDown.Name = "txtNumericUpDown"

    'Make it read-only so only you can edit it's value programmatically

    Me.txtNumericUpDown.ReadOnly = True 

    Me.txtNumericUpDown.TabIndex = 0

    'Set initial value for this component

    Me.txtNumericUpDown.Text = "0"

    '

    'bUp

    '

    Me.bUp.Name = "bUp"

    Me.bUp.Text = "^"

    ...

    '

    'bDwn

    '

    Me.bDwn.Name = "bDwn"

    Me.bDwn.Text = "v"

    ...

    'Add components to form

    Me.Controls.Add(Me.bDwn)

    Me.Controls.Add(Me.bUp)

    Me.Controls.Add(Me.txtNumericUpDown)

     

    'Form.vb---------------------------------------------------

    'Set Max Value For Your Numeric Up Down Component Here

    Dim nupdwnMaxVal As Integer = 100

    'Set Min Value For Your Numeric Up Down Component Here

    Dim nupdwnMinVal As Integer = 0

    '----------------------------------------------------------------

    Private Sub bUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp.Click

    If (txtNumericUpDown.Text < nupdwnMaxVal) Then

    txtNumericUpDown.Text += 1

    End If

    End Sub

    Private Sub bDwn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDwn.Click

    If (txtNumericUpDown.Text > nupdwnMinVal) Then

    txtNumericUpDown.Text -= 1

    End If

    End Sub

    '---------------------------------------------------------------------

    Like this.

    Thursday, August 31, 2006 5:15 PM

All replies

  • I don't know -and i don't think there is- a way to increase arrow size. One plain solution is to increase font size which will let you have bigger arrow size but also larger font size. Other way is to use a text box and two buttons and set properties as followed .

    'Initialization As Followed -----------------------------------------------------

    Me.txtNumericUpDown = New System.Windows.Forms.TextBox

    Me.bUp = New System.Windows.Forms.Button

    Me.bDwn = New System.Windows.Forms.Button

    '

    'txtNumericUpDown

    '

    Me.txtNumericUpDown.Name = "txtNumericUpDown"

    'Make it read-only so only you can edit it's value programmatically

    Me.txtNumericUpDown.ReadOnly = True 

    Me.txtNumericUpDown.TabIndex = 0

    'Set initial value for this component

    Me.txtNumericUpDown.Text = "0"

    '

    'bUp

    '

    Me.bUp.Name = "bUp"

    Me.bUp.Text = "^"

    ...

    '

    'bDwn

    '

    Me.bDwn.Name = "bDwn"

    Me.bDwn.Text = "v"

    ...

    'Add components to form

    Me.Controls.Add(Me.bDwn)

    Me.Controls.Add(Me.bUp)

    Me.Controls.Add(Me.txtNumericUpDown)

     

    'Form.vb---------------------------------------------------

    'Set Max Value For Your Numeric Up Down Component Here

    Dim nupdwnMaxVal As Integer = 100

    'Set Min Value For Your Numeric Up Down Component Here

    Dim nupdwnMinVal As Integer = 0

    '----------------------------------------------------------------

    Private Sub bUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp.Click

    If (txtNumericUpDown.Text < nupdwnMaxVal) Then

    txtNumericUpDown.Text += 1

    End If

    End Sub

    Private Sub bDwn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDwn.Click

    If (txtNumericUpDown.Text > nupdwnMinVal) Then

    txtNumericUpDown.Text -= 1

    End If

    End Sub

    '---------------------------------------------------------------------

    Like this.

    Thursday, August 31, 2006 5:15 PM
  • Hi,

    Thanks for the response. Changing the size of the Font does seem to be the only way to get the arrows to change size.

    There are a couple of size properties which do not seem to do much.

    Thanks for the code example.

    Jeff

    Tuesday, September 05, 2006 6:30 PM