Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Walter Milner
VB 6
0 Introduction
background to VB, A hello World program
1 Core language 1
2 Core language 2 3 Core language 3 4 Controls 5 Graphics 6 Forms 7 Files and databases 8 Deployment
Hello World in VB
Start VB New Project Standard .exe Click the Button control on the ToolBox and drag in the form Double click the new button to invoke the code editor Private Sub Command1_Click() MsgBox ("Hello world") End Sub Enter code: Click the Run button
Exercise try this out
VB is not..
Vendor independent Platform independent Based on a constant language definition Separated definition and IDE implementation Well documented (IMO) suitable for very large projects which must be maintained over a long period of time
VB is ..
easy to use suitable for RAD very marketable
f.BackColor = RGB(255, 0, 0)
It has a property called BackColor
Event-driven programming
Standard approach for GUIs Contrast with old character interfaces program determines what happens In GUI, the user triggers what application does (mostly) Event examples are key press, mouse move, timer timeouts Correspond to native Windows Messages (next slide) Event handler = a subroutine which will execute when that event happens