//-------------------------------- GUI Support Methods -------------------------------------- /// <summary> /// Purpose: To clear GUI Interface /// </summary> public void ClearGUI() { _count = 0; RBtnSalary.Checked = false; RBtnHourly.Checked = false; RBtnSales.Checked = false; RBtnContract.Checked = false; TxtEmpID.Text = EMPID; TxtName.Text = EMPNAME; TxtEmpType.Text = EMPTY + ETYPE.NONE; LblValue0.Text = LABEL0; TxtValue0.Text = DZERO; LblValue0.Show(); TxtValue0.Show(); LblValue1.Text = LABEL1; TxtValue1.Text = DZERO; LblValue1.Show(); TxtValue1.Show(); LblValue2.Text = LABEL2; TxtValue2.Text = DZERO; LblValue2.Show(); TxtValue2.Show(); RTxtDisplay.Clear(); RTxtDisplay.AppendText(MSG0); }
/// <summary> /// An event to clear the display window and the textboxes, also sets the focus in the name textbox. /// </summary> /// <param name="sender">MnuClear_Click</param> /// <param name="e">Not Used</param> private void MnuClear_Click(object sender, EventArgs e) { RTxtDisplay.Clear(); TxtName.Clear(); TxtScore.Clear(); TxtName.Focus(); }//End MnuClear()
}//End MenuExit() /// <summary> /// Event to grab stuff from textboxes and ending on an empty string. /// </summary> public bool GetInput() { bl.GrabName = TxtName.Text; bl.GrabScore = TxtScore.Text; bl.Grab4Split = TxtName.Text + "," + TxtScore.Text; if (bl.GrabName == "") { return false; } else { try { RTxtDisplay.Clear(); bl.AddNewPlayer(); bl.DisplayResults(); //RTxtDisplay.SelectionAlignment = HorizontalAlignment.Center; RTxtDisplay.AppendText(bl.DisplayResults()); bl.SplitIsStupidInGui(); // THIS IS ONLY TO MEET SPEC, AND IS A HUGE WASTE OF TIME. } catch (IndexOutOfRangeException a) { RTxtDisplay.Clear(); RTxtDisplay.AppendText(a.Message); return false; } catch (Exception b) { RTxtDisplay.Clear(); RTxtDisplay.AppendText(b.Message); } } return true; }//End GetInput()
}//End MnuAbout() /// <summary> /// An event used to dispay instruction about the program to the user via the RichTextBox /// </summary> /// <param name="sender">MnuInstructions_Click</param> /// <param name="e">Not Used</param> private void MnuInstructions_Click(object sender, EventArgs e) { RTxtDisplay.Clear(); RTxtDisplay.AppendText(NoMagicThings.INSTRUCTIONS_MSG); }//End MnuInstructions()
}//End FrmLoad() /// <summary> /// An event used to display information about the author in the RichTextBox /// </summary> /// <param name="sender">MnuAbout_Clic</param> /// <param name="e">Not Used</param> private void MnuAbout_Click(object sender, EventArgs e) { RTxtDisplay.Clear(); RTxtDisplay.AppendText(NoMagicThings.DIALOG_ABOUT); RTxtDisplay.AppendText(NoMagicThings.DIALOG_ABOUT_MSG); }//End MnuAbout()