Craft > Visual Basic Tips

SwansonSoftware Home | Site Index | View With Frames

Draft Version 1.10, January 30 2004

Contents

  1. Introduction
  2. Error Handling
  3. File Operations
  4. String Operations
  5. Compiled or IDE?
  6. Printing
  7. Controls
  8. Subclassing
  9. Visual Basic's OOP Capabilities
  10. Links to More Information
  11. References

Introduction

Next | Top of page

Visual Basic (VB) bears little resemblance to earlier BASIC languages. Mechanisms are built into VB that improve semantic clarity and ensure semantic validity of program code.

VB is a structured language - GOTOs are not required because control structures are available. VB is a strongly typed language - variables must belong to a specific type (if you don't declare a variable as a specific type the variable is of variant type). VB takes care of variable initialization, preventing a common semantic error that occurs when you use a uninitialized variable.

The syntax of the language has been expanded with each version, while maintaining restrictions on features that would give the language more access to Windows' system functions but would also make the language inappropriate for application development. For example, VB allows coherent assignment of compound objects (arrays, classes), but does not have unsigned integers and its type safety interferes with bit shifting.

With VB .Net the language is now fully object-oriented. Versions 4 through 6 grew more object oriented with nearly every version: classes appeared in VB 4.0, polymorphism (with the Implements key word) in VB 5.0. Implementation inheritance appeared with VB .Net.


Error Handling

Next | Previous | Top of page



File Operations

Next | Previous | Top of page



String Operations

Next | Previous | Top of page



Compiled or IDE?

Next | Previous | Top of page



Printing

Next | Previous | Top of page

Print Preview - Demonstrates how to add Print Preview functionality to a VB application.


Controls

Next | Previous | Top of page


Subclassing

Next | Previous | Top of page

System Tray Icon - Shows how to use AddressOf instead of a subclassing control to add an icon to the system tray.


Visual Basic's OOP Capabilities

Next | Previous | Top of page

Four criteria must be implemented by any language that is fully object-oriented:


Evolution of OO Features in Visual Basic



Links to More Information

Next | Previous | Top of page

Reference

Name Rating Description
VB Home Best Microsoft's Visual Basic Home
FAQ   Hot Issues, Service Packs or Hotfixes, Setup and Conversion, General Information

General Information

Name Rating Description
MSDN Best Microsoft's MSDN Home
Desaware Best Desaware's site - best reference articles
Kurata Good Deborah Kurata's site
Carl Peterson   Carl Peterson's site
DevX Mixed Bag Discussion forums, articles, code, product demos
PT N/A ProgrammingTutorials

Free Code

Name Rating Description
VBnet Best The best source for code, techniques and how-to information for Visual Basic.
VB Accelerator   Very little trash ad and they get right to the point with code and documentation.
VBExplorer Good Code, FAQ, tutorials, forums
CodeCranker Good Dr. Dobb's DevSearcher, their Programmer's Search Engine
VB Town Mixed Bag This site used to be ok, but now it has far too many spam ads
VB Thunder OK VB Thunder
AndreaVB   Andrea's VB site - articles and code, useful message board
VB2themax   VB 2 the max
TheScarms   Code library covering Visual Basic and Win32 APIs. Discussions, screen shots, Windows and registry tips, etc.
PlanetSource    
VB helper   Code tips, books, links

Grab Bag

Name Rating Description
VB Square Good Now developer.com
CodeArchive Good CodeArchive
Matthart Good Another good VB site - it seems there is no end to them.
VB Techniques Mixed Bag Articles, tips, forum
VB Source Mixed Bag VB Source

References

Most of the examples described on this page were developed by the author, Gregory Swanson.

Microsoft® Visual Basic Help was used often while developing the examples on this page.

Appleman, Daniel, 1996, Visual Basic Programmer's Guide to the Win32 API: Ziff-Davis Press, 1,518 pages. ISBN 1-56276-287-7
Detailed information on using the Win32 API in Visual Basic.

Robichaux, Paul, 2000, Managing the Windows 2000 Registry: O'Reilly & Associates, Inc., 541 pages. ISBN 1-56592-943-8
Details on the proper use of Windows' registry API.



Top of page | Previous