Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: visual basic programing
Description: This is a stepping stone for beginners and it create easy access to visual basic programming language. It teaches d basic fact about visual basic.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Visual Basic Programming
An Introduction

Why Visual Basic?
Programming for the Windows User
Interface is extremely complicated
...

H Visual Basic provides a convenient method
for building user interfaces
...

H

What Visual Basic is not
Visual Basic is not, a powerful
programming language that enables you to
do anything you want
...

H Visual Basic is not, a replacement for C
...

H

When You Program in VB:
You draw pictures of your user interface
...

H You add little snippets of code to handle the
user interaction
...

H If you like, you can code more complex
functions
...
)
H

The Visual Basic Interface

Draw Your
Program
Here!

Drawing The Program
Select A Control From Here
(Click on the appropriate button)
Then Draw the control on the form

Types of Controls
Static Text
Group Box
Check Box
Scroll Bar
Drop-Down List
Timer
Folder Hierarchy
Circles and Stuff
Pictures

Pictures
Editable Text
Button
Radio Button
List
Scroll Bar
Drive List
File List
Lines
Data Base Access

And the List Goes On and On
...


Adding Code
Control
Name

External Event
Name

You must Write
The Body
Yourself

What to Do When It Happens

More Complex Controls
H

Complex Controls Have:
– Action Properties to Execute Commands
– Active Properties that Cause Actions When
Values Are Assigned to Them
– Many Types of Events for Program Interaction

H

Examples:
– Spreadsheets
– Word Processors
– Web Browsers

Using C Code
Write a DLL in C
H Use the _export Property on Appropriate
Functions
H Write Visual Basic Definitions for each
Function
H Add VB Definitions to The (general)
section of the VB Program
H Use Functions as if they were VB functions
H

C Definition vs
...
DLL”
(ByVal InString As String) As Long
Function Name Must Be The Same in Both Declarations
...

Argument Name in VB is arbitrary
...
DLL file
...
DLL file to the
WINDOWS directory
...

H

Alternative Methods
Some Versions of VB do not allow DLL
function definitions in the (general) section
of a form
...

H

Syntax Considerations
All Functions are Global in VB
H Variables are declared using the syntax:
H

– Dim As
– Every variable must have a type
– Dim A,B,C As will work, but gives
weird results
H

Most Common Types: Integer, String, Long

More VB Syntax
H

Use Integers for Booleans
– As in C, 0 = False, everything else = True
– Symbolic constants True and False may be used
– True = -1, False = 0

Assignments are the same as in C
H The Val function converts strings to integers
H The Format$ function converts integers to
strings
H

VB Statements
Assignments are the Same as in C
H Case is not significant
H

– Case will be adjusted for you on keywords
– For Variable Names, Case is ignored
H

The Usual Operators can be used
– AND is the same as both & and && depending
on context
– OR = | and ||
– NOT = !

VB IF Statements
If Then

Else

EndIf

If Then

EndIf

Comparators: =,<, >, <=, >=, < > (not equal)
Connectives: And, Or, Not

DON’T FORGET THE ENDIF!

VB While Statements
While do

Wend

The VB Manual Recommends a different structure
...


VB For Statements
For = to

Next
For = to Step

Next
Example:
For I = 1 to 10 do
A[I] = A[I] + 1
Next I

VB Arrays
Indices Always Start With Zero
H Dim A[10] As Integer Declares 11 elements,
indexed from 0 through 10
...

H Arrays can be resized at run time (See VB
Help File for ReDim)
H

VB Strings
Variable Length
H Compare using standard comparators
H Maximum length is about 64Kb
H Minimum length is zero
H Allocated from VB “String Space”, so may
run out of space even on systems with much
memory
...


Go
Have
Fun!

Visual Basic Programming
An Introduction

Why Visual Basic?
Programming for the Windows User
Interface is extremely complicated
...

H Visual Basic provides a convenient method
for building user interfaces
...

H

What Visual Basic is not
Visual Basic is not, a powerful
programming language that enables you to
do anything you want
...

H Visual Basic is not, a replacement for C
...

H

When You Program in VB:
You draw pictures of your user interface
...

H You add little snippets of code to handle the
user interaction
...

H If you like, you can code more complex
functions
...
)
H

The Visual Basic Interface

Draw Your
Program
Here!

Drawing The Program
Select A Control From Here
(Click on the appropriate button)
Then Draw the control on the form

Types of Controls
Static Text
Group Box
Check Box
Scroll Bar
Drop-Down List
Timer
Folder Hierarchy
Circles and Stuff
Pictures

Pictures
Editable Text
Button
Radio Button
List
Scroll Bar
Drive List
File List
Lines
Data Base Access

And the List Goes On and On
...


Adding Code
Control
Name

External Event
Name

You must Write
The Body
Yourself

What to Do When It Happens

More Complex Controls
H

Complex Controls Have:
– Action Properties to Execute Commands
– Active Properties that Cause Actions When
Values Are Assigned to Them
– Many Types of Events for Program Interaction

H

Examples:
– Spreadsheets
– Word Processors
– Web Browsers

Using C Code
Write a DLL in C
H Use the _export Property on Appropriate
Functions
H Write Visual Basic Definitions for each
Function
H Add VB Definitions to The (general)
section of the VB Program
H Use Functions as if they were VB functions
H

C Definition vs
...
DLL”
(ByVal InString As String) As Long
Function Name Must Be The Same in Both Declarations
...

Argument Name in VB is arbitrary
...
DLL file
...
DLL file to the
WINDOWS directory
...

H

Alternative Methods
Some Versions of VB do not allow DLL
function definitions in the (general) section
of a form
...


H

Syntax Considerations
All Functions are Global in VB
H Variables are declared using the syntax:
H

– Dim As
– Every variable must have a type
– Dim A,B,C As will work, but gives
weird results
H

Most Common Types: Integer, String, Long

More VB Syntax
H

Use Integers for Booleans
– As in C, 0 = False, everything else = True
– Symbolic constants True and False may be used
– True = -1, False = 0

Assignments are the same as in C
H The Val function converts strings to integers
H The Format$ function converts integers to
strings
H

VB Statements
Assignments are the Same as in C
H Case is not significant
H

– Case will be adjusted for you on keywords
– For Variable Names, Case is ignored
H

The Usual Operators can be used
– AND is the same as both & and && depending
on context
– OR = | and ||
– NOT = !

VB IF Statements
If Then

Else

EndIf

If Then

EndIf

Comparators: =,<, >, <=, >=, < > (not equal)
Connectives: And, Or, Not

DON’T FORGET THE ENDIF!

VB While Statements
While do

Wend

The VB Manual Recommends a different structure
...


VB For Statements
For = to

Next
For = to Step

Next
Example:
For I = 1 to 10 do
A[I] = A[I] + 1
Next I

VB Arrays
Indices Always Start With Zero
H Dim A[10] As Integer Declares 11 elements,
indexed from 0 through 10
...

H Arrays can be resized at run time (See VB
Help File for ReDim)
H

VB Strings
Variable Length
H Compare using standard comparators
H Maximum length is about 64Kb
H Minimum length is zero
H Allocated from VB “String Space”, so may
run out of space even on systems with much
memory
...


Go
Have
Fun!


Title: visual basic programing
Description: This is a stepping stone for beginners and it create easy access to visual basic programming language. It teaches d basic fact about visual basic.