Here is what I was working on:
Create a GUI application that allows the user to enter
an hourly pay rate in a TextBox. When the user clicks
a button and the value in the TextBox is less than
$7.50, display an error message
This is my source code:
double payrate;
double actualyPayRate = 7.5;
payrate = Convert.ToDouble(inputTextBox.Text);
if (payrate < actualyPayRate)
displayLabel.Text = "Illegal pay rate!";
else
displayLabel.Text = "Thank you!";
I am curious if there is another way to do the same work, any suggestions?
Check low
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Dec 15, 2011, 11:16 AM EST
Prime bRank #2,035 · 712 reputationPosted Dec 15, 2011, 2:12 PM EST
Sam HobbsRank #107 · 20.5K reputationPosted Dec 15, 2011, 3:25 PM EST
When you are more experienced with C#, you can develop a class derived from TextBox that ensures valid data interactively as the user types each key. As a beginner, you can use the MaskedTextBox Class to do that.