Try:
Public Class Form1
' NumericUpDown1
'.Minimum = 1
'.Maximum = 64
'.Increment = 1
'.value = 4
Dim NumList() As Integer = {1, 2, 4, 8, 16, 32, 64} ' list of admitted values
Dim NumExValue As Integer = 4 ' put the default value on numericUpDown
Dim NumDoChange As Boolean = True ' used for not looping in changeValue event
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
' if the event is calling from this event (when set .value) do nothing
If (NumDoChange = False) Then Exit Sub
With NumericUpDown1
Dim cv As Integer = .Value
' if no change (possible?) do nothing
If (cv = NumExValue) Then Exit Sub
' if the value IS on array do nothing
Dim ix As Integer = Array.IndexOf(NumList, cv)
If (ix >= 0) Then
NumExValue = cv
Exit Sub
End If
' if precedent value is 8 and up arrow pressed
' the current value is 9 so i search the index in array of
' value -1 and i take next element
If (cv > NumExValue) Then ' up arrow
ix = Array.IndexOf(NumList, cv - 1) + 1 ' get next element
NumDoChange = False ' stop ValueChanged event
.Value = NumList(ix) ' here start a call to this event
NumDoChange = True ' reset ValueChange event on
End If
' the same but precedent element
If (cv < NumExValue) Then ' down arrow pressed
ix = Array.IndexOf(NumList, cv + 1) - 1
NumDoChange = False
.Value = NumList(ix)
NumDoChange = True
End If
NumExValue = .Value
End With
End Sub
End Class
numericUpDown
method. – Kevin Cruijssen