Open up Visual Basic and click on Standard Exe once you’re form has loaded put 2 Command buttons on your form and a text box and give them the names “cmdGood” and “cmdBad” it doesn’t matter which one has what BUT don’t give you’re buttons a caption leave them as they are and give the text box the name txtMsg.
Double click on “cmdGood” button and insert in this code:
Private Sub cmdGood_click()
Form1.Caption = "Visual Basic is Good"
txtMsg.Text = "Visual Basic Rules!"
End Sub
After that double click on cmdBad button and insert this code:
Private Sub cmdBad_click()
Form1.Caption = "Visual Basic is Bad"
txtMsg.Text = "Visual Basic Sucks!"
End Sub
Then after that click on the form its self and insert this code:
Private Sub Form_Load()
Form1.Caption = "Visual Basic Is..."
cmdGood.Caption = "Good"
cmdBad.Caption = "Bad"
txtMsg.Text = ""
End Sub
When you have entered the code it shoud look like this:
Explanation of the code.
cmdGood and cmdBad
Form1.caption – This changes the text at the top of the forms title bar from form1 to Visual Basic is good/bad
txtMsg.text – This puts text in the text box.
Form_Load
Any code put into the form load event will be executed when the program is started, this is where you would put you're spash scren code.
Form1.caption – This changes the text at the top of the forms title bar from form1 to Visual Basic is…
cmdGood.Caption – This gives the command buttons its Caption it changes it from Command 1 to Good the same goes for cmdBad
txtMsg.Text = “” – this is the same as above BUT since there is no text in between the speech marks it just makes the text box empty.
Click Run > Start and click the buttons and watch what happens
Well there you go! There is you’re second program. Click File > Make project1.exe to make it a .exe, for you’re homework, I suggest you play about with the Properties VIA code.
If you have any questions just post them. Hope you liked my tutorial!
RoNsOn