
The first white box you se is a label but in the text part of the properties I've put a whole heap of spaces and made sure the background colour is white. The second box is a button where the text has been changed to 'CHECK'. The final box is a text box where the user can type somehing in. I put the following code into the code of the button.
If TextBox1.Text = "heads" Then Label1.Text = "win"
If TextBox1.Text = "tails" Then Label1.Text = "lose"
The code above is an example of selection. If you misspell heads or tails or use a capital letter then the label will stay the same as the last one.
A solution to this problm would be to use radio buttons because the user wouldn't type in something wrong. To put the radio buttons in I put in the following code:
If Heads.Checked = "true" Then Label1.Text = "win"
If Tails.Checked = "true" Then Label1.Text = "lose"
A user friendly programme should always allow for user input errors
If TextBox1.Text = "heads" Then Label1.Text = "win"
If TextBox1.Text = "tails" Then Label1.Text = "lose"
The code above is an example of selection. If you misspell heads or tails or use a capital letter then the label will stay the same as the last one.
A solution to this problm would be to use radio buttons because the user wouldn't type in something wrong. To put the radio buttons in I put in the following code:
If Heads.Checked = "true" Then Label1.Text = "win"
If Tails.Checked = "true" Then Label1.Text = "lose"
A user friendly programme should always allow for user input errors
No comments:
Post a Comment