|
| |
macro language for Microsoft Applications |
| |
widely used |
| |
object oriented programming |
| characteristics (properties) | |
| function | |
| events |
| objects | |
| forms | |
| controls | |
| characteristics (properties) | |
| the property box | |
| function | |
| methods | |
| code |
| mouse click | |
| key press | |
| other |
| |
Design the interface (visually) |
| |
Set the properties- Name ALL objects using standard prefixes |
| |
Write the Code |
|
Object Type |
prefix | Example |
| Form | frm | frmHello |
| Text Box | txt | txtHello |
| Label | lbl | lblHello |
| Command Button | cmd | cmdExit |
Naming conventions
| form | frmSomething |
| text box | txtSomething |
| command button | cmdSomething |
| label | lblSomething |
| Design the interface | |
| Set the Properties | |
| Write the Code
|
| Start Visual Basic 6.0 | |
| Design the interface | This is already done in this case- the only object we will use is the form itself. |
| Set the properties | name= frmHello caption = Hello BackColor= make it blue FontColor= make it white Font= pick a nice, big one! |

Type the code
Print "Hello"
When the form is activated (the program is run) the Activate event has occurred, so the code is executed.
| Design The Interface | We only need the form and a button |
| Set the Properties | Use the same properties as
above for form.
For the Button: name=cmdHello caption=Hello |
| Write the Code | Double-click on the button
Enter the following code: MsgBox("Hello, World") |
| Design the form |

| Set the properties | ||
| Form | name = frmHello BackColor = Blue Caption = Hello World |
|
| Command Button | name = cmdHello caption= Hello |
|
| Command Button | name=cmdClear caption=Clear |
|
| Command Button | name=cmdExit caption=Exit |
|
| Label | name=lblHello caption=lblHello pick a nice font and colors |
|
| Write the Code | cmdHello cmdClear cmdExit |
lblHello.Text = "Hello, World!" lblHello.Text = "" end |
![]()
Complete exercises 1 - 13 in chapter 3 (beginning on page 3-23).
![]()
![]()