private void NumberOfScanpointsTextBox_TextChanged(object sender, EventArgs e) { int value; if (Int32.TryParse(NumberOfScanpointsTextBox.Text, out value)) { if (NumberOfScanpointsTextBox.Focused) { controller.NumberScanPointsChanged(value); } } }