Graphical
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
order.
Variables
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.
Program
Flow
Structured programming is based around three basic constructs:
1. Sequence
2. Selection
3. Iteration.
The Sequence construct is the simplest, whereby statements
are executed in the order they're found in the code.
Events
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.
Graphics
As well as the shape control, there are three Methods that
can be used for producing graphics in Visual Basic.
1. PSet,
2. Line
3. Circle.
These methods can be used on a Form, PictureBox, or Printer object.
Working
with Strings
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
value.
Working
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
# operator.
Drag
and Drop
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
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.
Debugging
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".
File
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
files.
Regular
Expression Object
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.
Common
Dialog Control
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
library COMMDLG.DLL.
Database
Connectivity
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.
Classes
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.
ActiveX Components
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
and FTP)
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.
Using XML
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.
|