Reputation: 11
i am creating a project for my class (C# in visual studio) that works as a token dispensing machine.
The user clicks on a button that changes the textbox with the label number of quarters from 0 to 1 and continues to increase that number by 1 each time the user clicks the button, the next textbox with the label number of tokens starts at 100 and decreases by 1 each time the user clicks the button mentioned above.
I have the code correct for the most of that, my question is how to get the textboxes to display the numbers 100 for number of tokens and 0 for the number of quarters when the program STARTS. Not when the button is clicked.
Upvotes: 0
Views: 2064
Reputation: 5636
There are two simple ways to accomplish this for a Win Forms application:
Form_Load
event, you can programmatically set the values using the form of textBox.Text = "[DESIRED_VALUE]";
Upvotes: 1