xilica
05-18-2002, 02:02 PM
note: I used Visual Basic 6 for this.
When Visual Basic Loads click Standard EXE on the New Project form.
When Form 1 is loaded:
1. Click on the properties window.
2. Height to 5000
3. Width to 7000
After you finished sizing the form in the above exercise locate the Tools on the left side. Click once on the Command Button which looks like a box. It is located on the third row. Drag the Command Button anywhere on the form. Do the following in the properties window:
1. Height to 1200
2. Width to 4500
3. Left to 1200
4. Top to 1680
5. Caption to Click Here
Now, click the Font property... a dialog box box named Font should appear. Do the following:
1. Font Syle to Bold
2. Size to 14
Adding the Code:
Double on the Command Button we just put out. As you notice, a different window pops up. This is where the code goes that will power your application.
Private Sub Command1_Click()
Command1.Caption = "Hello World"
End Sub
Annalying the Code:
You have added Command1.Caption = "Hello World". Since it's name is Command1 and its job (in this program you wrote) is to provide a caption you state its name and its job. By the way, you can change its name to anything you want in the properties window. For instance, if you changed it to CommandOne and you wrote this program you would have to write your code like this:
CommandOne.Caption = "Hello World"
The text you typed in can also be anything you want as long as you keep the quotations around the text you wish you appear.
Running the program:
This is the fun part where you get to see how your work has paid off. Locate the "Run" menu bar. Click on the "Run" Menu and then start. This will run your program. Also, a quicker way to run the program is to just simply hit F5 on your keyboard. When you run your program notice how the grid dots aren't there. These dots just help you line objects up and set items where you want. Click the command button and you see the words Click Here change to Hello World
Congratulations on behalf of writing your first application.
note: If you find any bugs or errors which occur please notify me by either Private Messaging me or posting in this thread. Also, if you have any positive or negative comments on this program please notify be my Private Messaing me or posting in this thread.
When Visual Basic Loads click Standard EXE on the New Project form.
When Form 1 is loaded:
1. Click on the properties window.
2. Height to 5000
3. Width to 7000
After you finished sizing the form in the above exercise locate the Tools on the left side. Click once on the Command Button which looks like a box. It is located on the third row. Drag the Command Button anywhere on the form. Do the following in the properties window:
1. Height to 1200
2. Width to 4500
3. Left to 1200
4. Top to 1680
5. Caption to Click Here
Now, click the Font property... a dialog box box named Font should appear. Do the following:
1. Font Syle to Bold
2. Size to 14
Adding the Code:
Double on the Command Button we just put out. As you notice, a different window pops up. This is where the code goes that will power your application.
Private Sub Command1_Click()
Command1.Caption = "Hello World"
End Sub
Annalying the Code:
You have added Command1.Caption = "Hello World". Since it's name is Command1 and its job (in this program you wrote) is to provide a caption you state its name and its job. By the way, you can change its name to anything you want in the properties window. For instance, if you changed it to CommandOne and you wrote this program you would have to write your code like this:
CommandOne.Caption = "Hello World"
The text you typed in can also be anything you want as long as you keep the quotations around the text you wish you appear.
Running the program:
This is the fun part where you get to see how your work has paid off. Locate the "Run" menu bar. Click on the "Run" Menu and then start. This will run your program. Also, a quicker way to run the program is to just simply hit F5 on your keyboard. When you run your program notice how the grid dots aren't there. These dots just help you line objects up and set items where you want. Click the command button and you see the words Click Here change to Hello World
Congratulations on behalf of writing your first application.
note: If you find any bugs or errors which occur please notify me by either Private Messaging me or posting in this thread. Also, if you have any positive or negative comments on this program please notify be my Private Messaing me or posting in this thread.