예제 #1
0
 private void HasAValueBeenEnteredButton_Click(object sender, EventArgs e)
 {
     if (EnterAValueTextBox.Text == String.Empty)
     {
         MessageBox.Show("Go back and enter a value...");
         EnterAValueTextBox.Text = String.Empty;
         EnterAValueTextBox.Focus();
         return;
     }
     else
     {
         HasAValueBeenEnteredLabel.Text = "Yes!";
     }
 }
예제 #2
0
 private void IsTheValueTheLetterAButton_Click(object sender, EventArgs e)
 {
     if (EnterAValueTextBox.Text == String.Empty)
     {
         MessageBox.Show("Go back and enter a value...");
         EnterAValueTextBox.Text = "";
         EnterAValueTextBox.Focus();
         return;
     }
     else if (EnterAValueTextBox.Text == "A" || EnterAValueTextBox.Text == "a")
     {
         IsTheValueTheLetterALabel.Text = "Yes.";
     }
     else
     {
         IsTheValueTheLetterALabel.Text = "No.";
     }
 }
예제 #3
0
        private void IsTheValueANumberButton_Click(object sender, EventArgs e)
        {
            double isDouble;

            if (EnterAValueTextBox.Text == String.Empty)
            {
                MessageBox.Show("Go back and enter a value...");
                EnterAValueTextBox.Text = "";
                EnterAValueTextBox.Focus();
                return;
            }
            else if (Double.TryParse(EnterAValueTextBox.Text, out isDouble))
            {
                IsTheValueANumberLabel.Text = "Yes.";
            }
            else
            {
                IsTheValueANumberLabel.Text = "No.";
            }
        }