1. Computing & Technology

VB 6 is The King

VB6 was once the most popular programming environment in the entire history of the world! But even if it's not as great as it was, it's still a great place to start learning about programming if you have the software! (If you don't, it's hard to find. Microsoft is actually trying hard to stamp it out and they don't sell it anymore.) One reason is that the original BASIC ("Beginner's All purpose Symbolic Instruction Code") was designed as a language to teach people how to program by Kemeny and Kurtz at Dartmouth College w-a-a-a-y back in 1963. A lot of very talented programmers have said that VB 6 is still the best development environment. You can check out their reasons here and here.

Learning VB 6

In the 'Essentials' topic Learning Visual Basic, a program that uses one form with two command buttons was introduced.

We're going to go through the complete steps to create this. First ... in rapid fire ... the steps. Then ... a more complete explanation.

  1. Start Visual Basic. Usually, 'Start > Programs > Microsoft Visual Studio > Microsoft Visual Basic 6.0'. You should see a window similar to this:
  2. Click the default "Standard EXE" icon and then click the "Open" button.
  3. Drag a 'Command Button' from the 'Toolbox' to the form and drop it. Drag another one to the form and drop it.
  4. Click the first 'Command Button' to select it. Open the property window and change the 'Name' property to 'CommandA'.
  5. Select the second 'Command Button' from the drop down window at the top of the property window and then change the 'Name' property to 'CommandB'.
  6. Double click the first 'Command Button' object in the form to open the code window for that button.
  7. Enter the code, Msgbox "You clicked Button A" after the automatically entered code Private Sub CommandA_Click()
  8. Double click the second 'Command Button' object in the form to open the code window for that button.
  9. Enter the code, Msgbox "You clicked Button B" after the automatically entered code Private Sub CommandA_Click()
  10. Click the 'Run' button in the toolbar at the top of the VB 6 development environment window to execute the program.
  11. Click either button A or button B and observe the fruits of your labor!

Whew!!! Continue on to the next page to do this a little slower.

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.