Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
 /// <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();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Focuses the user input text
 /// </summary>
 private void FocusInputText()
 {
     UserInputText.Focus();
 }
Ejemplo n.º 4
0
 private void button17_Click(object sender, EventArgs e)
 {
     this.UserInputText.Text = string.Empty;
     UserInputText.Focus();
 }