WinForms . there are 20 textboxes and 20 Label next to it(they say what do you mean tb).
All the values the user enters. All values should be double.
I usually write like this (possibly a Fig) code:
private void TbLnsDist_TextChanged(object sender, EventArgs e)
string val = tbLnsDist.Text;
val = val.Replace(",", decimal_sep);
val = val.Replace(".", decimal_sep);
bool res = double.TryParse(val, out number);
if (res == false)
lbLnsDist.Text = "Enter a number!";
lbLnsDist.ForeColor = Color.Red;
btnLnsCreate.Enabled = false;
lbLnsDist.Text = "Distance";
lbLnsDist.ForeColor = Color.Black;
btnLnsCreate.Enabled = true;
However, controls became a lot.
In such cases it is correct to do the check? a separate class with methods? or is it in each control to write its review?