VB 6 Sample Code
-
Send File to Recycle Bin in VB .NET
by Walter Steed
.NET version of "Send file to Recycle Bin"
-
Treeview and ADO
by mohd adzhar
This code will save the treeview node when click add region/branch in Access format. When run the program the treeview will load the Access file.
-
Compact & repair MS Access database
by Mike J
Simple snippet of code to compact and repair any MS Access database.
-
ADO Utility Class
by NeverMalchik
ADO class containing useful functions - counting records, creating database from scratch, openning/closing database, filling listbox/combo box with an sql statements, manipulating records....and much more.
-
ASCII to Binary string
by Mike J
How to obtain the binary string for the ASCII code of a character.
-
Making Windows Transparent
by Yew Chin Sing
Demonstrates how to make a form in VB transparent.
-
"On Error Resume Next" considered harmful
by Palo Mraz
Discusses some unexpected implications of using the 'On Error Resume Next' statement in Visual Basic applications.
-
Register Program to Start Up Automatically
by Yew Chin Sing
Demonstrates some VB code to register your application to automatically startup (in the registry).
-
Basic ADODC Example
by Moriel Schottlender
Too all you newbies out there, This is something I wrote for a friend of mine, teaching how to use the basic extraction-from-db utilities. It shows how you can link an Access database using the ADODC Component. It includes thorough explanations and examples. It really is teaching the basics of ADODC components - nothing fancy - I just remembered my own time as a beginner, trying to search for new ways to learn. I hope it will help you :) ~moo
-
Decimal Integer to Binary String
by Michael H
Converts an Integer up to 65535 to a String of Binary digits.
-
Check if Printer is Installed
by ss
This function will check whether a printer is connected/installed the system
-
Adding real Win32 tooltips for windowless controls
by 10Tec Company
The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. The following trick allows you to create real Windows tooltips for VB intrinsic controls which do not have this property.
-
Add Quick MP3 Audio Functionality to your Programs
by Cooper Sloan - VB6FREAK
Add Quick MP3 Audio Functionality to your Programs - A tutorial on adding MP3 audio, without the use of the Windows Media Component. Uses MCI, so users of the Multimedia Control should have an idea of what to expect.
-
File Searching
by Luke Lesurf
This code will search a folder and all sub folders for a specified file or filter.
-
Get Free Disk Space On Large Drives
by Luke Lesurf
This code will allow you get the free disk space on a drive which is over 2 Gb in size.
-
Load M3U playlist
by Marc Pritchard
How to load an M3U playlist for use in a media/music program.
-
A better rounding function
by Luke Lesurf
VB's built in round function will round numbers like 12.085 down to 12.08. This is not correct in all cases as this number should be rounded up to 12.09. This round function allows for this.
-
Basic media playing class
by Marc Pritchard
Uses the mciSendString API to play media files via the MCI.
-
VB Syntax Highlighter
by Alex
With this code you can highlight VB code. keywords, sub names, and function names are included as well as comments.
-
Create a "Trial" Period
by Alex
This fairly short piece of code allows the program to check whether a trial period of any length has expired, notifying the user how many days are left. The user is given the option to register the program or just not use it any more. It uses the VB registry setting functions. Encryption can be added when saving to the registry so that almost nobody at all can use the program for longer than the trial period.