Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
The numeric value of the Windows Forms NumericUpDown control is determined by its Value property. You can write conditional tests for the control's value just as with any other property. Once the Value property is set, you can adjust it directly by writing code to perform operations on it, or you can call the UpButton and DownButton methods.
Assign a value to the Value property in code or in the Properties window.
NumericUpDown1.Value = 55
numericUpDown1.Value = 55;
numericUpDown1->Value = 55;
-or-
Call the UpButton or DownButton method to increase or decrease the value by the amount specified in the Increment property.
NumericUpDown1.UpButton()
numericUpDown1.UpButton();
numericUpDown1->UpButton();
Access the Value property in code.
If NumericUpDown1.Value >= 65 Then MessageBox.Show("Age is: " & NumericUpDown1.Value.ToString) Else MessageBox.Show("The customer is ineligible for a senior citizen discount.") End If
if(numericUpDown1.Value >= 65) { MessageBox.Show("Age is: " + numericUpDown1.Value.ToString()); } else { MessageBox.Show("The customer is ineligible for a senior citizen discount."); }
if(numericUpDown1->Value >= 65) { MessageBox::Show(String::Concat("Age is: ", numericUpDown1->Value.ToString())); } else { MessageBox::Show ("The customer is ineligible for a senior citizen discount."); }
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback: