There are 4 textbox fields. You need to create some method to assign the textbox.Text=0 an empty field. If you write everything through if else , you get a whole mountain of code. Ugly.
1 answer
You can through the event handler:
private void textBox1_Validated(object sender, EventArgs e) { if (((TextBox)sender).Text == "") { ((TextBox)sender).Text = "0"; } } Sign it on all boxes.
Took from here: https://stackoverflow.com/questions/17902882/how-to-enter-a-default-value-when-a-textbox-is-empty
|
NumericUpDownto enter numbers instead ofTextBox. - Alexander Petrov