Visual Programming

  Visual Basic Tutorial

VB Commands You Should Know


The Basics

How do you unload a form

e.g. Form7

 


Show a form

e.g. Form3

 


Hide a form

e.g. frmAbout

 


Display a message box to a user.

e.g.

 


Declare a whole number variable

e.g. declare a variable called studentGrade

 


Declare a large whole number

e.g. declare a variable called hopedForStudentGrade

 


Declare a number with a decimal part

e.g. declare a variable called bankBalance

 


Declare a large number with a decimal part

e.g. a variable called bigBankBalance

 


Declare a String variable

e.g. a variable called password

 

   

File Handling

 


Open a data file ready for writing data (without appending)

e.g. a file called A:\error.txt

 

 

 
 

Open a data file ready for appending data

e.g. a file called error.txt

 

 

 
 

Close a file

e.g. close all open files

 

 

 
 

Check a number is in a textbox

e.g. the ? mark below represents missing code. Type in the missing code for checking there is a number is in a textbox called txtNum.

If (     ?    ) Then

 

 

 
 

Check a number is NOT in a textbox

e.g. the ? mark below represents missing code. Type in the missing code for checking there is NOT a number is in a textbox called txtNum.

If (     ?    ) Then

 

 

 
 

Check to see if a textbox is empty

e.g. the ? mark below represents missing code. Type in the missing code for checking a a textbox called txtName is empty

If (     ?    ) Then

 

 

 
 

Check to see if a textbox is NOT empty

e.g. replace the ? mark below with the proper code for checking a a textbox called txtName is NOT empty

If (?) Then

 

 

   

Event Handling

 

Specify the sub routine that runs when the form loads

 

Specify the sub routine that runs when the user clicks a command button

 

Specify the sub routine that runs when the user clicks a listbox item

 

Specify a sub routine that runs when the user clicks a menu item

 

 


Fini
 

 

 

   

  Unit Information

Assessment

Syllabus

Scheme of Work

Notes &Tutorials

Assignments

Quizzes

Books & Things

Links

ADR 2002