Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6

Similar presentations


Presentation on theme: "Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6"— Presentation transcript:

1 Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup PPCC - Introduction to VB6

2 Materials & Prerequisites
Software: Visual Basic 6.0 A Working Model in included with the book Course will target the VB 6 Professional Edition Check with MS for free 90 day trial edition Participant CD VB 6 Service Pack 5 Microsoft Jet 4.0 Service Pack 8 Get the one that matches your system!!! Microsoft Data Access Components (MDAC) downloads can be found from: Microsoft Data Access Components (MDAC) 2.7 SP1 Refresh MDAC Buffer Overrun Secrity Patch MS04-003 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup PPCC - Introduction to VB6

3 Course Outline, Week 1 Getting Started with VB6
Installation & Setup of VB6 for development Launching VB6 VB6 Settings The VB6 IDE 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup PPCC - Introduction to VB6

4 Course Outline, Week 1 Your first app (Hello World)
Running the application Calculating an approximation of PI Very simple – use 22/7, but use controls for input/output Designing a user interface 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup PPCC - Introduction to VB6

5 Course Outline , Week 1 Adding code to your application
Visual Basic Statements Simple Variable and Constant Declarations Assignment Statements and Expressions If … Then … Else … End If Accessing controls on the form Control Properties, Methods, and Events Simple controls: TextBox, Label, CommandButton, Timer ListBox and ComboBox File, Directory, and Drive – example of control interaction 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup PPCC - Introduction to VB6

6 The Parts of VB6 The Integrated Development Environment
This is the VB6 editor/form designer/compiler Visual Studio 6.0 Tools Most of these are for advanced users Sample Projects On-Line Help = MSDN Library See differences between VB6 Editions: 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

7 Launching VB6 You will find Microsoft Visual Basic 6.0 on your Start > Programs menu "First Choice": New | Existing | Recent See the different choices under each: New Create a new project allows selection of new project from Templates and Wizards Existing Browse for existing VB project files Recent The most recent projects opened in VB6 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

8 New Project Options Standard EXE
Typically used for standard applications Loads with the intrinsic VB6 controls in the toolbox Loads a new project with a single form 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

9 New Project Options ActiveX EXE or ActiveX DLL
Used to create objects used by (other) applications No forms included, creates a single Class module 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

10 New Project Options ActiveX Control
Allows developing your own controls (that can be used on forms in other applications) Loads with the intrinsic VB6 controls in the toolbox Loads a new project with a single form-like UserControl module 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

11 New Project Options VB Application Wizard Addin
Based on user selections, VB creates a skeleton application ready for entering code to handle menu and button events, etc. Addin Creates a project that runs as an add-in under the VB6 IDE 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

12 New Project Options Data Project
Creates a new project that contains a single Form, a DataEnvironment object and a DataReport object This project includes a number of references to support Data Access and Data Binding It also includes several additional controls in the toolbar 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

13 New Project Options Customization
You can add your own project templates and form templates, etc. C:\Program Files\Microsoft Visual Basic\VB98\Template\… If you don’t want the initial dialog to show when you launch VB6, check "Don’t show this dialog in the future". 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

14 VB 6 Settings 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

15 VB 6 Settings 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

16 VB 6 Settings 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

17 VB 6 Settings 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

18 The VB6 IDE 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

19 The VB6 IDE 3/2/2004 PPCC - Introduction to VB6
Copyright ©2004, Tore Bostrup

20 The VB6 IDE The Forms Designer
The Toolbox window contains the controls available for use Double click an icon in the Toolbox or Click an icon in the Toolbox and click and drag the sizing handles on the form Release the mouse button Resize control by selecting and click & drag sizing handles 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

21 The VB6 IDE The VB6 Menu and Toolbar Selection Coordinates Left, Top
Width, Height Run, Pause, Stop Application debugging Opens the different windows Examples of custom toolbars Add project, Add "module", Menu editor 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

22 The VB6 IDE The VB6 Menu and Toolbar Bookmark buttons Indent/Unindent
selected block of code Breakpoint Toggle Comment/Uncomment selected block of code Intellisense helpers Intellisense usually kicks in automatically Buttons are not too frequently used 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

23 The First App – Hello World
Open VB6 Create a New Standard EXE project Double-click the form Enter the following code in Sub Form_Load() MsgBox "Hello World" Press F5 or click the  button 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

24 Hello World Variations
Using constants and expressions Sub Form_Load() Const WORLD = "World" MsgBox "Hello " & WORLD End Sub 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

25 Hello World Variations
Using Controls and Variables Place a CommandButton on the form Add a Label, TextBox, and another Label to the form Make the Caption for the first label "Name" Double-click the Button Enter the following code in Sub CommandButton1_Click(): Dim sHello as String sHello = "Hello " & Text1.Text Label2.Caption = sHello Press F5 to run, enter a name and click the button 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup

26 Hello World Variations
This is what your form and code should look like: 3/2/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup


Download ppt "Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6"

Similar presentations


Ads by Google