Welcome

Welcome to VB6.us. Visual Basic 6 is still very alive and active. Many business have huge applications written in this great language. Wouldn't it be nice to have current VB6 tutorials and VB6 source code samples? Many people learn this language as their first development language and many use it every day for work.

This site is dedicated to helping you learn and advance in Visual Basic 6.0. We currently have numerous Visual Basic tutorials and Visual Basic source code samples for all levels from beginner to intermediate to advanced. There is also in depth VB6 guides. You can also post questions in the VB6 forum where the maintainer of this site and others will be able to help you. Below is a list of all our latest articles. Also please use the links on the left to browse our different sections or the search in the upper right corner of this page to find something specific.

Latest VB6 Tutorials

Level:
Level3

Creating Advanced PDF documents in VB

This VB tutorial builds off the last and demonstrates how you can create more advanced PDF files. It teaches you how to create a multi-page document, with page headers, footers, page numbers, shapes, and images.

In the previous tutorial we looked out how to create a simple PDF document that was one page and was only text. If you've seen many PDF documents on the web or elsewhere you know that they usually include more than just text. Fortunately we are able to do these things as well.

Level:
Level2

Creating PDF files in Visual Basic

Creating PDF documents in Visual Basic has always been a difficult task. Many times people have to purchase controls to do it for them. Not with this Visual Basic tutorial. PDF documents can be created in a snap using the mjwPDF class. This is the first in a series of tutorials. It covers the creation of a basic PDF document.
Level:
Level1

VB6, Windows 7, Good or No Good?

So you have all these great Visual Basic 6 applications that have been built with blood and sweat over years of struggle and Microsoft releases Windows 7. Will your applications still run? Are you going to have to do any heavy lifting to make them work? This tutorial walks you through what to look for when verifying your VB apps continue to work on the latest version of Windows. It also gives examples of 5 of the most popular apps and code examples on our site and how they hold up to Win 7.
Level:
Level2

VB6 Animated Charts (With FusionCharts)

Often times when writing a Visual Basic application we need to display boring data in a more appealing way. This is where charts come in handy. This tutorial explains how you can create charts from within VB6. It specifically shows how to create animated charts using a third part control called FusionCharts.
Level:
Level2

VB6 Downloads

Want to get a hold of Visual Basic 6.0? Do you have a program written in VB that you wish to run but don't have the VB6 runtime any longer? Have an older program and want to get it running on the latest OS. Read this article for information about downloading VB6 and other VB components.
Level:
Level2

Make a Club Penguin Trainer

Club Penguin is a sweet site where you can make your own fun trainers. This tutorial shows you how to do so in Visual Basic.
Level:
Level2

Convert C Strings to VB Strings

You will find times that you need to interact with other programs code through DLLs. These can be DLLs written by yourself or others. The most common time you do this is with the Windows API. This tutorial explains how you can convert C style strings like the Win32 API uses into VB strings.
Level:
Level2

Activate Any Window With API

This VB6 tutorial teaches you how you can use Visual Basic coupled with the Win32 API to activate the main window of a program that is running. Very useful if you want to check if a program is running or if you want to bring another program to the forefront.
Level:
Level2

VB6 Programming Standards

When designing a program you will want to think through what standards you should use for yourself and your end users. This VB6 tutorial guides you through how to do this.
Level:
Level2

VB6 Naming Conventions

Developing a standard naming convention for all your Visual Basic objects and variables will make your code easier to understand and update down the road. This VB6 tutorial walks you through the best way of doing this.
Level:
Level1

Documenting Your VB Code

Properly documenting your Visual Basic code will not only help you later as you make changes but it is also something that any professional developer must have a full grasp on.
Level:
Level2

Naming Database Objects

When creating complex database applications in Visual Basic it is very helpful if you use a standard naming convention for your database objects. This might seem trivial but in the long run will save you development time down the road.
Level:
Level2

Access SQL

Microsoft Access allows you to create, retrieve, and manipulate data using the SQL language. This tutorial explains all the main ways you will want to use this SQL language within your Visual Basic application or other programs.
Level:
Level3

Access Security

Microsoft Access is a great database application that is easy to interface into from within Visual Basic. A key thing you might want to learn is how to implement the proper security for your database.
Level:
Level2

VB6 With Access

Microsoft Access is a very useful and effective database application. It uses the Microsoft JET database back end and your Visual Basic applications can easily interact with it.
Level:
Level3

Using Jet Data Access Objects

Microsoft has a great database back end called JET. It is most known because the program called Microsoft Access uses it. You can also use this same database in your Visual Basic applications. This VB6 tutorial explains how.
Level:
Level3

Optimizing Database Applications

Optimize, Optimize, Optimize! This is how you can create the best, fastest, most user friendly apps. In this tutorial you learn what the optimum way to do database development is.
Level:
Level3

Database Design

As you begin to program more advanced programs that store data in databases you will need to understand how to layout the database in the most efficient way. This will allow you to create Visual Basic applications that run as quickly as possible.
Level:
Level1

What are databases and why do I care?

Database development is very confusing if you don't understand how databases work and what the heck you are supposed to do with them. This article teaches you exactly what you need to know to get started with databases.
Level:
Level3

Using The Win32 API

The Win32 API is a bit complex but very powerful. This tutorial shows you how to easily use the Windows API in a simple way. It explains the safety steps you need to take and how to write excellent API code.
Level:
Level1

Variable Scope and Duration In VB

Understanding how variables work is very important. Learn how Visual Basic handles scope and duration with this tutorial.
Level:
Level1

Optimizing Visual Basic Applications

Visual Basic is a great language that can be used to create full featured applications. Learn how to optimize your code to create faster, more efficient, and user friendly applications.
Level:
Level1

Error Handling In Visual Basic

Errors happen. This is how programming works. Your goal is to handle runtime errors in a graceful way. At times this means simply displaying them to the end user in a pretty way. Other times you have to handle them yourself. Learn how with this Visual Basic tutorial.
Level:
Level1

Event Programming In VB6

Visual Basic allows you to easily create event driven applications. Depending on your background this might be very new for you to understand. This tutorial shows you exactly how to begin as an event driven programmer.
Level:
Level1

What edition of VB to choose

There are many versions of Visual Basic to choose from. How do you decide which version to use? This guide will help you make this decision.
Level:
Level1

Using VB Help Files

Visual Basic comes with a bunch of help files. These are great for reference, but they can also be used by the beginner to see samples and to begin learning. Learn the best way to go about this.
Level:
Level1

Using the VB IDE as a Learning Tool

Some good advice as you start to learn Visual Basic, this tutorial introduces the VB6 IDE and helps the beginner think through how to start tackling this great programming language.
Level:
Level2

PlaySound API In Visual Basic

The PlaySound API is a simple and very useful function that allows you to play any WAV file from within your Visual Basic application. This includes playing built in Windows sounds that are set through the control panel.
Level:
Level2

Move The Mouse in VB

You can use the Windows API to move the mouse cursor around the screen. Learn how with this VB6 tutorial.
Level:
Level2

Advanced Shell In Visual Basic

Visual Basic has a built in Shell command however it is very limited. This tutorial describes how you can use the Windows API functions to create a "Super Shell". This will allow you have more advanced program launching abilities.

Latest VB6 Source Code Samples

Level:
Level2

VB6 Barcode Software

Barcodes are everywhere. From produce at the super market to tattoo’s on peoples necks. At first glance every barcode looks the same. However, in reality there are many different types of codes that encode data in different ways. Barcode software is able to detect what type of encoding the barcode is using by looking at the layout of the blocks in the code. This in and of itself is a fascinating feat. However, the more fascinating thing is that a seemingly random set of blocks actual can encode some pretty interesting information.

Level:
Level1

Use API To See If Windows Started In Safe Mode

You can interact with any built in Windows API function from Visual Basic. This source sample shows how we can use the GetSystemMetrics API function in order to find out if Windows was started in safe mode or not.
Level:
Level1

Drag and Drop With List Box

Drag and Drop is cool and very useful feature that any modern application must implement. This sample demonstrates how you can allow users to drag files from explorer onto a listbox.
Level:
Level1

Simple way to store strings in the Registry

The Windows Registry is a great place to store program settings. Visual basic has SaveSettings and GetSettings functions to be able to easily store and retrieve data from the registry.
Level:
Level1

Convert HTML Color to RGB

In this day and age you will find yourself needing to convert colors that are specified in the format for websites into RGB colors that can be used in your VB programs. This is easy to do with this very simple code snippet.
Level:
Level1

Fancy Collapsing Form Exit

New VB developers quickly learn how to Unload their forms. This source code snippet shows you how you can add a little style to your form unloading event. Instead of just making it disappear the form will shrink into non-existence.
Level:
Level1

Replace Text in a TextBox

Many people have seen the Find and Replace functionality in Word or other applications. You can implement similar functionality in your VB programs with just a few lines of code.
Level:
Level1

Count the number of words in a textbox

At times we want to say that so many words can or must be entered in a text box field. Getting the character count of a field is easy in Visual Basic, but getting the word count takes a little more work. This source code shows you how to calculate this word count.
Level:
Level1

Remove an element from an array

Visual Basic Arrays are very handy and at times somewhat complicated, especially if you want to remove an item from it or redefine its size. This VB sample shows you how to do this.
Level:
Level1

Save the contents of a list box to a file

Controls in VB are very handy. However, none of them have built in methods to save their contents out to the hard drive. This source sample shows you exactly how to take all the items in a list and save them into a text file you specify.
Level:
Level1

Copy a File Quickly

Visual Basic can be used for lower level functionality such as copying all the data from one file into another one. This source code sample shows you how to do this using the Open, Get, Put, and Close File IO Functions.
Level:
Level1

Print 3D Gradiant text on a form

This is a simple and fun example of a cool effect you can do in VB - Setting the forms background to a gradiant of color. It also showcases how you can use the VB6 For loop.
Level:
Level1

Fill a combo box with system fonts

Every Window's system has a bunch of fonts installed on it that we can use to display text in different ways. This sample shows how we can use Visual Basic's Screen object to query these fonts and list them all in a combo box.
Level:
Level1

Launch a program from VB

A fun thing to develop when you are first learning how to program is a program launcher. This sample source code shows you how you can use VB's built in shell command in order to launch other programs from within your custom application.
Level:
Level1

Center your form on the screen

Visual Basic gives us access to the Screen object in order to find out information about the end users screen resolution and other settings. We can use this in order to make our form appear in the center of the screen. This sample source code shows you how.
Level:
Level1

Get tag info form a mp3 file

MP3 files are common place now days. When Visual Basic 6.0 first came out MP3 files weren't even used. However, you can still use VB6 to read all the tag information of this song files.
Level:
Level1

A very basic web server Test

Writing network related programs is fun and exciting. At times it almost seems like magic. This source code sample shows how you can create a very basic web server that when your browser connects to it the specified text will show up in the browser. This uses the Microsoft Winsock control.

This source code sample demonstrates how you can create a very, very, basic web server. It is not intended for you to actually use but instead to just wet your appetite with a simple networking example.

Level:
Level1

Looping through files and putting them in a control

See an example of how you can interact with the system to find out all files in a given folder. Further add all these files (and their paths) to a listbox control.
Level:
Level1

Delete A File - Snippet

Learn in this simple source code snippet exactly how you can delete a file from your computer using Visual Basic. It is a very simple example to showcase the Kill command in VB.
Level:
Level1

Tile A Picture - Quick Source

A simple source snippet that shows how you can tile any image both horizontally and vertically on a VB form.
Level:
Level2

Create PDF in VB Source Code

This sample source code shows you exactly how to create a PDF file from within your VB application with out having to buy a third party control or dll. It gives an example of creating a PDF and adding text to it.
Level:
Level2

A simple calculator

This full program is a simple calculator like what comes with windows. It demonstrates many controls and commands.
Level:
Level2

A full game - Concentration

See how to write a full working version of the Concentration game.
Level:
Level2

Full hangman game in VB6

Learn how to create a full hangman game with graphics. This program uses forms, timers, graphics, and many other common controls.
Level:
Level2

Creating a graphic tic tac toe game in VB6

This code shows a full tic tac toe. It uses forms, graphics, a simple AI algorithm, and other fun game stuff.
Level:
Level2

A Cryptogram game - simple encryption in VB6 source

This is a simple game that also shows how to do a fun cryptography method. It also teaches you forms, graphics and other basic VB controls.
Level:
Level3

Roman Numeral Converter

This program converts an integer in the range of 1 through 3999 to its equivalent in Roman numerals. It also converts a Roman numeral string to its decimal equivalent.
Level:
Level3

Advanced multiple client server using the Winsock control

See how to build an advanced client server chat like program that allows multiple connections (like IRC) using the Winsock control.
Level:
Level2

Simple Client Server chat program using Winsock control

Would you like to write your own chat or IM program? This sample demonstrates how you can use the VB6 Winsock control to build a simple client server application.
Level:
Level2

Building a highscore manager for your game

Every great game keeps tracks of users high scores and displays them. See how to do just that.