using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace FCC_Uber_MDX_Configurator { public partial class FunctionInputAddingForm : Form { public FunctionInputAddingForm() { InitializeComponent(); } #region Verify Text Field is Valid private void Leave_VerifyTXTIsNotEmpty(object sender, EventArgs e) { try { TextBox _senderBox = (TextBox)sender; if (_senderBox.Text == "") { ErrorForm _tempErrorForm = new ErrorForm(_senderBox.Name, "The value you entered is not valid"); _tempErrorForm.ShowDialog(); _senderBox.Focus(); } } catch (Exception) { ErrorForm _tempErrorForm = new ErrorForm("Unknown Error", "There was an unexpected untraceable error caught in the application. If you can reproduce this error, please let me know at FusionControlCentre@gmail.com"); _tempErrorForm.ShowDialog(); } } #endregion private void BTN_SAVE_Click(object sender, EventArgs e) { if (TXT_NAME.Text == "") { (new ErrorForm("Invalid Name", "The input must have a valid name")).ShowDialog(); return; } this.DialogResult = DialogResult.OK; } private void BTN_CANCEL_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } public object GetReturnNameInfoBack() { if (TXT_NAME.Text == "") { return null; } return (object)TXT_NAME.Text; } } }