I am trying to understand a piece of code in order to refactor it. There are several verifications for the input value to check if they are valid, and on each verification there is a line of code that I do not understand what it does.Here is the code:
if (IsNotDouble(weight))
{
MessageBox.Show("Weight must be a numeric value!");
txtWeight.Select();
return;
}
txtWeight is a textbox.
Can anyone tell me what txtWeight.Select() does here.I can not understand why this piece of code should be posted here after each time an error is thrown.
It sets the cursor into the textbox where you have to enter the weight.