Tuesday, August 10, 2010

Heads & Tails

Last Wednesday on August 4, we had a task called heads & tails where we had to run the program Microsoft Visual Basic, and create a new project with a form. Then we had to drag the label, button and text box from the toolbox to the form and change the name/property from BUTTON1 to CHECK and then edit the code for the label by inserting
If TextBox1.Text = "heads" Then Label1.Text= "win"
If TextBox1.Text = "tails" Then Label1.Text = "lose"
So then when you type heads into the text box the label at the top of the form will say win, and then if you type tails into the text box the label will say lose.









No comments:

Post a Comment