Selasa, 07 April 2009

visual basic.60

VB 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'.
2. Click the default Standard EXE icon and then click the Open button.
3. Click the Command Button icon in the Toolbox. Draw two buttons on the form by clicking and dragging.
4. Click the first Command Button to select it. Open the property window and change the Name property to CommandA. Change the Caption to A.
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. Change the Caption to B.
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 CommandB_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.

·
Visual Basic







Step 1 and Step 2
Start Visual Basic. Usually, 'Start > Programs > Microsoft Visual Studio > Microsoft Visual Basic 6.0'.Click the default "Standard EXE" icon and then click the "Open" button.
You should see the opening dialog window as explained in Learning Visual Basic. Check that page out for more.
Step 3
Drag a 'Command Button' from the 'Toolbox' to the form and drop it. Drag another one to the form and drop it.
The VB 6 development environment is designed to let you constantly change the components that are visible so you can work with only those windows that apply to the problem at hand. The 'ToolBox' is one of those components and may, or may not, be visible in your system. The 'Toolbox' looks like this: (The tools that are in the toolbox can change too!)
If you can't see the toolbox, look for it in the 'View' menu. And notice that several other components can be turned on and off there, too. Some that you will use are:
· Project Explorer
· Immediate Window
· Locals Window
· Watch Window
Another thing to know is that VB 6 uses the right-click 'context menu' a lot. Right click 'Form1' for example and notice the options there. This is the fastest way to switch between viewing an object (like Form1) and the code in that object.
Next page > Finishing the Two Button Form > Page 1, 2, 3, 4,

.
.

Tidak ada komentar:

Posting Komentar