Nota
Pristup ovoj stranici zahteva autorizaciju. Možete pokušati da se prijavite ili promenite direktorijume.
Pristup ovoj stranici zahteva autorizaciju. Možete pokušati da promenite direktorijume.
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.
To set the numeric value
Assign a value to the Value property in code or in the Properties window.
NumericUpDown1.Value = 55numericUpDown1.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();
To return the numeric value
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 Ifif(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."); }
See also
.NET Desktop feedback