VBRad Source Code Samples and Development Tips

This is our on-line library of VB Souce Code and Tips for the VB Programmer interested in pursuing excellence in the craft. Check here frequently for new samples as this section is constantly being added to. Some of this stuff can really come in handy - if you ever find yourself asking - "I wonder if its possible to do _______ in VB" then this section should definitely be one of the first places for you to look to fill in that blank. Its also a great place to just peruse occasionally and pick up little gems of information that can make you more productive. Lets face it - the VB Space is large, and no one knows all of the ins and outs. But you can glean the collective wisdom of many professional VB developers in these pages.

We want very much for this site to be an interactive site for our intended audience - so if you have any source code or a tip of your own - please feel free to submit them and we will post them (after our review). Please see the submissions page for our guidelines on submissions.

The entries are organized alphabetically by category. If a particular item really belongs in more than one category then we will place it in more than one category.

Components

Real Stories of .NET Interop: C#, VB.NET and VB6 04/29/2004 (article)

API Techniques

Demonstration of Network API capabilities by Brian Yule 05/12/2004 (source)

Retrieve all kinds of IP/Network information by Brian Yule 03/03/2004 (source)

Custom Data Types in VB6 by Brian Yule 03/02/2004 (source)

Updated Winsock, including SSL, Ping, TraceRt, implementation without the Winsock control by Brian Yule 03/02/2004 (source)

An implementation of Win32 Crypto API 02/24/2004 (source)

Audio implementation of Win32 Multimedia API 02/11/2004 (source)

Create Popup menus on the fly without a Form by Brian Yule 08/25/2003 (source)

Retrieve Security Priviliges and Inheritance for Windows Directories by Brian Yule 08/05/2003 (source)

TAPI (Telephony) Wrapper by Brian Yule 09/18/2002 (source)

Region clipping and irregular forms for VB6 and .NET, Part II, Advanced by Brian Yule 09/06/2002 (source) (updated)

Advanced System Tray component with baloon tooltips by Brian Yule 08/07/2002 (source)

Region clipping and irregular forms by Brian Yule 07/31/2002 (source)

Handy class to manage Environment Variables 03/08/2002 (source)

Who's your daddy or how to find the EXE that loaded the DLL 02/21/2002 (source)

Prevent certain lines in a TextBox from being edited (source)

How to close a shelled process (source)

How to undo a textbox (source)

How to open and close the CD-ROM drive (source)

Autosize the dropdown portion of the ComboBox (source)

Set maximum lengths for the textbox portion of the ComboBox (source)

How to retrieve available system drives (source)

A Fix for the ancient VB Scroll Bar bug! (source)

Detecting when an App loses or receives focus. (source)

Determining Various System Paths. (source)

Preventing the Default Context Menu appearing over a Text Box. (source)

Another way of Overiding the Default Context Menu in a Text Box. (source)

Quickly Searching ListBox and ComboBox Controls (source)

Database & Data Access

Make ugly SQL pretty 10/16/2002 (source)

Read any delimited file into a recordset 01/18/2002 (source)

Export Fixed Length Files with ease. 01/08/2002 (source)

Four ways to page through records 10/24/2001 (article & source)

Retrieve ADO Version 10/24/2001 (source)

The right way to clone an entire recordset 10/24/2001 (source) (updated)

Best ADO Cloning & Filtering Practices 06/01/2001 (source)

Speed updates with this handy BCP class 03/21/2001(source)

Avoid pitfalls when connecting to Sybase using ADO 03/05/2001(tip)

Passing Null Date Parameters to a Stored Procedure on Sybase (source)

Create an ADO Connection string fast and easy. (tip)

Accessing ISAM databases, Excel, HTML, etc... with ADO. (tip)

ALTER TABLE Gotcha in Access/DAO/ADO (tip)

Clone Recordset Structure (source)

Quickly dump a Recordset onto an MsFlexGrid (source)

Break Access 97 password protected database (tip)

Fast way to copy table structure (tip)

Insane ADO .Filter bug (tip)

Environment

Top 10 reasons VB.NET is better than C#

Top 10 reasons C# is better than VB.NET

Start VB.NET or VB7 in SDI Mode (tip)

Commenting out blocks of code - super fast and easy. (tip)

Determining if your code is running in the Environment or is compiled. (source)

Quickly Adjust Font Sizes in Internet Explorer, MSDN Help, and Netscape. (tip)

Stupid Keyboard Tricks. (tip)

Forms and Form Handling, GUI Techniques

Owner-drawn listbox with multiple colors in the same line 06/21/2004 (source)

Adding great features to form's system menu via inheritance 04/11/2004 (source)

Print Vertical Text with Alignment Options 12/26/2002 (source)

Delay loading WebBrowser or any other control 02/22/2002 (source)

Prevent certain lines in a TextBox from being edited (source)

Free Gradient ActiveX Control (source included) (source)

HTML ListBox Generator Class (source)

Detecting when an App loses or receives focus. (source)

How to Drop Down darn near anything (source)

Free Gradient ActiveX Control (source included) (control)

A Fix for the ancient VB Scroll Bar bug! (source)

Preventing the Default Context Menu appearing over a Text Box. (source)

Another way of Overiding the Default Context Menu in a Text Box. (source)

Quickly Searching ListBox and ComboBox Controls (source)

Tray Icon Control that allows quick adding, modifying, animating the icons in the system tray. (source)

GIS and Mapping Techniques

Determining the distance between 2 points on the Earth's surface. (source)

How to get local time based on the GMT time (source)

Interfaces & Event Handling

Expose events from implemented classes. 04/20/01 (source)

Hiding Public Interfaces in your Classes. (tip)

Detecting when an App loses or receives focus. (source)

Internet Explorer

Create an icon for your Web site. (tip)

Hiding Public Interfaces in your Classes. (tip)

Quickly Adjust Font Sizes in Internet Explorer, MSDN Help, and Netscape. (tip)

Internet Information Server

Create IIS Virtual Directory programmatically. (source)

IIS Parameters.. Unexplained Phenomenon. (tip)

IIS and the Registry - @&*#@$#@! (tip)

Language Tricks

What Object.Class am I in? 10/26/2001(tip)

Conditional If (IIF) Gotcha! (tip)

The Best Way to Handle Populating a Checkbox from a Boolean Variable (tip)

Miscellaneous Techniques

Make Acrobat Reader load 75% faster! 06/21/2004 (source)

VB6 Implementation of XML Parser 02/11/2004 (source)

Convert Internet Date/Time formats to VB date 06/28/2002 (source)

MSCOMM Troubleshooting Guide & Tutorial 06/28/2002

Easy Encryption Class 06/05/2002 (source)

The easiest way to make NT Service with VB6. 05/30/2002

Sort a Collection of Objects by any Property. 03/08/2002 (source)

Archive and Extract files with these components. 01/03/2002 (source)

Converting a Currency Variable to an English Descriptive Phrase. (source)

How to check whether the computer supports sound (source)

Play sound (wave file) (source)

Free Downloadable Programs/Plugins/Add-Ins/Binaries

HTML Commenter Add-in for VS.NET 2003

Property Builder Add-in for VB.NET 2003

Line Swap Add-In This Visual Basic IDE Add-In is a simple, but effective time saver by switching text on both sides of the equal sign.

Snippet Master This Visual Basic IDE Add-In is a simple, but effective Code Repository. Source code is included, so you can also learn how to create Add-Ins.

Quick Search 2.0 Change the way you search for files in Windows forever. Save tons of time with this free & innovative file search utility. 05-14-2001

Name Box Resizer COM Add-in for Excel 2000 (source included) - learn various api techniques, plus how to build COM Add-ins. If you are a hardcore Excel user - this is a must have app. 12-16-2000

Excel Name Box Dimension Changer (source included) - learn hardcore api tricks to safely change screen elements in other programs. Same program as above, but works with Excel 97, has more API stuff, but it isn't a COM Add-in. 11-30-2000

ADO Stored Procedure Code Generator (source included) 04/16/2001

SuperTray allows customizable quick access to various resources (souce included)