User Interface (GUI) Components
The properties describe the appearance of the GUI component.
When adding a component, the Name property should be set immediately,
according to the three-letter mixed naming conventions. The properties
are displayed in the Properties Window in Name/Value pairs in alphabetical
Most programs require the temporary storage of data. The data is
stored in a variable, which is a temporary storage in the
computer's memory. The variable name is the "identifier",
used to identify the data.
Structured programming is based around three basic constructs:
The Sequence construct is the simplest, whereby statements
are executed in the order they're found in the code.
An event occurs in response to an action, such as the user
clicking the mouse or pressing a key in the application. An event
handler is a routine that responds to the event.
As well as the shape control, there are three Methods that
can be used for producing graphics in Visual Basic.
These methods can be used on a Form, PictureBox, or Printer object.
Left, Right and Mid are three Visual Basic functions
to locate sections of a string. All of the following examples
use the string "strExample" with the following
with Dates and Times
The basic data type Date is used in Visual Basic
to store the date and time. Date literals are enclosed within the
Setting the DragMode Property of a control to "Automatic",
allows a control to be dragged. For an action to be performed, a
corresponding DragDrop Event will need to exist.
For example, to reposition the control on a different
part of the Form, the Form would require a DragDrop event.
Procedures and functions provide a means of producing structured
programs. Rather than repeating the same operations at several different
places in the program, they can be placed in a procedure or function.
and Error Handling
Visual Basic has built in Error Scanning to check
for syntax errors. For example, if you forget to put the
"Then" keyword at the end of an If statement, you get
an error message saying, "Expected: Then or GoTo".
Handling and the FSO Object
The File System Object (FSO) enables you to manipulate the
files, folders and drives as well as read and write to sequential
Regular expressions are used to match patterns of text,
enabling you to manipulate text easily. The regular expression object
in VBScript is called RegExp, and has three properties,
and three methods.
The Common Dialog Control provides a standard interface
for operations such as opening, saving, and printing files or selecting
colours and fonts using the Microsoft Windows dynamic link
To use ADO, you must set the appropriate references by selecting,
Project, References, and making sure there's a tick against
Microsoft ActiveX Data Object Library.
and Object Oriented Programming
Instead of breaking down a problem into smaller chunks as with
procedural programming techniques, object-oriented programming
is achieved by viewing the problem as a collection real-life Objects.
An ActiveX Component may either be an ActiveX EXE,
ActiveX DLL or an ActiveX Control.
Creating a COM Object
The Component Object Model (COM) is a Microsoft framework
for managing component objects, allowing them to communicate by
calling methods of other components in their object workspace.
TCP/IP Network Programming
Network programming is based around the Winsock control.
To use the Winsock Control, add it to the ToolBox by selecting the
"Components" menu item and select "Microsoft
Winsock Control 6.0" from the list.
Internet Programming (HTTP
The WebBrowser control provides the functionality of Internet
Explorer through point and click hyperlinks.
The Windows API
The Windows Application Programming Interface (API) is a
set of Windows functions that can be incorporated in your program.
The Extensible Markup Language (XML) is perfect for data
sharing requirements in an application.
Using Treeview Control
The Treeview Control holds a collection of nodes so to add
a node to the Tree you need to define a new node and then add that
node to the Treeview's collection.