/// <summary> /// Attempts to validate the input by retrieving it from <see cref="InputManipulation"/> and passing it through <see cref="ValidInput(string, out string)"/> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UserInputText_Validating(object sender, System.ComponentModel.CancelEventArgs e) { // error message that's defined and presented to the user when an error occurs. string errorMsg; // if the function ValidInput returns false, it returns the error message provided if (!ValidInput(InputManipulation(), out errorMsg)) { // Cancel the event and select the text to be corrected by the user. e.Cancel = true; UserInputText.Select(0, UserInputText.Text.Length); // Set the ErrorProvider error with the text to display. this.equationErrorProvider.SetError(UserInputText, errorMsg); } }
/// <summary> /// Focuses the user input text. /// Basically makes it so anytime a button is clicked /// the cursor stays in the user input textbox. /// </summary> private void FocusInputText() { //Focusing the cursor on the user input text box UserInputText.Focus(); }
/// <summary> /// Focuses the user input text /// </summary> private void FocusInputText() { UserInputText.Focus(); }
private void button17_Click(object sender, EventArgs e) { this.UserInputText.Text = string.Empty; UserInputText.Focus(); }