Visual Basic 6 Source Code Samples



Even though temporarily commented, the snippets are also production, debugged code. This page has over 13,000 words of VB6 and SQL source code snippets, examples, samples, etc. A lot of the syntax remains eternal in the land of Visual Basic. Hopefully these code libraries will serve people well for many years. In the following section, you can find a variety of Visual Basic code samples. For every sample, you can download the entire project for opening in Visual Basic 6.0. Revealing the passwords behind asterisks in Internet Explorer This small utility reveals the passwords stored behind the asterisks in the web pages of Internet Explorer 5.0 and above. O Visual Basic Code Samples for Windows Phone. O Free ebook: “Programming Windows Phone 7, by Charles Petzold” – VB Code Samples (direct) o Windows Phone 7 Development For Absolute Beginners on Channel 9. O Visual Basic Windows Phone 7 Tutorials (Part 1, Part 2, Part 3) o Silverlight 4 Training Kit.

  1. Visual Basic Sample Projects
  2. Visual Basic Sample Programs
  3. Sample Visual Basic Program Code
C# / .NET Code Samples
DotNetResourcesExtract v1.00
DotNetResourcesExtract is a small utility that scan dll/exe files of .NET applications, and extract all .NET embedded resources (Bitmaps, Gifs, HTML files, and so on) stored in them into the folder that you specify.
Code
Visual C++ Code Samples And Utilities
Programs

Visual Basic Sample Projects

Source Code Samples
Changing the screen brightness programmingly - By using the Gamma Ramp API
Some video cards allows you to programmingly modify the Gamma Ramp values.You can use this feature to change the brightness of the entire screen.
Preventing application crash by using exception handling mechanism
When a program does something wrong, for example, reading from invalid memory address,the operating system displays a 'crash' window with information about the problem that caused the exception,and terminates the application. This sample project demonstrates how to avoidthis kind of crashes, display your own exception information window,and allow the user to continue running the application after the exception occurred.
Moving items up and down in a ListView control.
In some occasions, you might want to allow the user the change the order of items in the ListView, by moving the selected items up and down. In the API of ListView control, there is no support for swapping between 2 items. The only way to do that, is by manually swapping all data of the items, including the lParam value and all columns !
Displaying 'Browse Folders' dialog with the default folder selected.
The 'Browse For Folder' dialog allows the user to select a folder from all available local drives and network resources. This code snippet demonstrate how to display this dialog-box.
Displaying the 'Properties' of a file or folder.
When you select a file or folder in Explorer window, and choose 'Properties' from the menu, you get the properties window that contains some essential information about the file: The size of file, created date, modified date, attributes, and so on.It's possible to display this properties window programmatically, by using the ShellExecuteEx API function.
Enumerating Windows credentials with CredEnumerate function
This code sample enumerates all credentials of the current logged on user,and dump them into the standard output.
Utilities With Full Source Code
ExeInfo v1.01
The ExeInfo utility shows general information about executable files (*.exe), dynamic-link libraries (*.dll),ocx files, and drivers files.
AtNow v1.1
AtNow is a command-line utility that schedules programs and commands to run in the near future.
WinExplorer v1.30
WinExplorer is a utility that shows all system's windows in hierarchical display.
For every window in the hierarchy, you can view its properties, like handle, class name, caption, size, position and more. You can also modify some properties, like Caption and Visible/Enable.
Source
Visual Basic Code Snippets and Utilities

Visual Basic Sample Programs

In the following section, you can find a variety of Visual Basic code samples. For every sample, you can download the entire project for opening in Visual Basic 6.0.

Sample Visual Basic Program Code

Revealing the passwords behind asterisks in Internet Explorer
This small utility reveals the passwords stored behind the asterisks in the web pages of Internet Explorer 5.0 and above.
Creating a real console application in Visual Basic !
Although the Visual Basic compiler doesn't allow officially to create console applications, it's possible to do it with a simple trick.
Read more >>
Revealing the passwords behind asterisks
This code snippet scans all opened windows, and reveals the passwordsbehind the password text-boxes.
Access 95/97 Password Revealer
This small utility reveals the database password of Microsoft Access files.
It works only with version 95 and 97 of Microsoft Access.
System resources in Windows 95/98
This code snippet shows the percentages of free system resources in Windows 95 and Windows 98.
Fast string concatenation
With this class, you can concatenate small strings into one big string in faster way than the standard '&' operator.
Using bidi32.dll for Logical-Visual conversion
This code snippet is designated for using in bidirectional systems only (Hebrew and Arabic).
It uses the functions in bidi32.dll to convert strings from Visual to Logical and from Logical to Visual.
Painting a Gradient between 2 colors on a form
This code snippet shows how to paint a gradient on a form using Win32 API.
Drawing a rotated text on a form
This code snippet demonstrate how to draw a rotated text on a form.
Creating a circle shaped window
This code snippet demonstrates how to create a circle shaped window, by using a few Win32 API calls.
Web client tester
With this small utility, you can send HTTP queries and see how the servers responds to those queries.
Faster items adding in ComboBox
This code snippet shows you how to add combo items with Win32 API. It's much faster than using the AddItem method of VB.
Faster items adding in ComboBox (with item data)
This code snippet shows you how to add combo items (both strings and items data) with Win32 API. It's much faster than using the AddItem method of VB.
Executing Control Panel applets
This code snippet shows how to run standard Control Panel applets (Display Properties, Reginal Settings, Mouse Properties, and more)from Visual Basic code.
Converting network drive-based path to universal path name
This code snippet shows how to use the WNetGetUniversalName for convertingnetwork drive-based path (Like I:windows) to universal path name (Like MyComputercwindows)
Opening special Explorer windows
This code snippet shows you how to open special Explorer windows, like My Computer, Control Panel, Printers, Fonts and more...
DoEvents alternative function
This code snippet shows how to create an alternative function for the standard DoEvents function.
Registering and using a new window class
This code snippet shows you how to register a new window class in Visual Basic anduse that class to create new windows, and show them on a form.
Displaying and using a dialog box from external DLL file
This code sample shows you how to display a dialog box from external DLL file.In this sample, the standard 'Run' dialog of Microsoft Windows is shown on the screen.
Displaying the 'Shut Down Windows' dialog
This code snippet displays the 'Shut Down Windows' by using undocumented API in shell32.dll
Getting the filename of an ActiveX class name
Title
Tax Declaration Calci1.09 in Visual Basic
'dancing mouse' -- randomly move the mouse pointer in visual basic
'finicky': paint program in visual basic
'lightweight' print preview dll in visual basic
'smart' select case for decision-making in visual basic
'xtreme player' -- mp3 player with skins in visual basic
.ini file reader and writer in visual basic
.net config file wrapper in visual basic
.net library to help manipulate/process text files in visual basic
.net scroll bar control in visual basic
.net system information class demo in visual basic
.net textdata provider demo in visual basic
1-click customization of controls in visual basic
1-click customization of controls v2 in visual basic
10 seconds (simple game) in visual basic
10 square tic-tac-toe in visual basic
12 Image Transitions in Visual Basic
2 Player Chess in Visual Basic
216 color pallette in visual basic
24-bit picture class w/ resize, crop, transregion and exposed bits in visual basic
24-bit picture class w/ resize, crop, transregion and exposed bits part 2 in visual basic
2d tileset creator (vb.net)
3 Phase Short and Medium Transmission Lines in Visual Basic
3-Layered Scrolling Background in Visual Basic
30 classes for 40 instruments in visual basic
3D Digital Reality Engine V1.00, PURE VB in Visual Basic
3D Font (version 2) in Visual Basic
3D Font in Visual Basic
3d grid waves animation in visual basic
3d label control in visual basic
3d label control part 2 in visual basic
3D Label in Visual Basic
3d line control with 13 styles in visual basic
3D Matrix Maths II (no openGL or DirectX required) in Visual Basic
3d maze maker in visual basic
3d mesh collision detection in visual basic
3d mesh editor in visual basic
3d sample applications in visual basic
3d soccer field in visual basic
3D Spinning Cube Demonstration in Visual Basic
3d terrain without using any apis or external components in visual basic
3D text in Visual Basic
3D Tube Animation in Visual Basic
3d world with a snowman in visual basic
3dstudio files (3ds) viewer in visual basic
52 card deck maker in visual basic
6/49 lotto combination generator in visual basic
6/49 Lotto Combination Generator Program in Visual Basic
6/49 lotto game with dynamic html simulation in visual basic
8Queens Game in Visual Basic
a .net class to calculate circles in visual basic
a .net drag-n-drop puzzle in visual basic
a .net-based directx sound capture and recording application in visual basic
a 3d demo w/o directx or opengl in visual basic
A 3D Label control in Visual Basic
A 8085 Simulator in Visual Basic
a barebones 24bit wave audio reader in visual basic
a base64 / mime encoding and decoding class. in visual basic
a basic c# console application sample in visual basic
a basic calculator application in visual basic
a basic dao connection method in visual basic
a basic database interaction sample in visual basic
a basic drag and drop sample in visual basic
a basic employee database system in visual basic
a basic pythagoras implementation in vb6
a beautiful card game. in visual basic
a better app.path in visual basic
a better chr() function in visual basic
a binary search algorithm in visual basic
a c# overloaded method to calculate an md5 hash in visual basic
a c# rss feed retriever sample in visual basic
a calendar example similar to windows date and time properties in visual basic
a class for searching datagrids in visual basic
a class for system, logical drivers, memory, display drivers, etc. in visual basic
a class to preserve message boundaries using tcp and the vb winsock control
a class to resize the controls on the form as the form resizes in visual basic
A Code Library for Programmers in Visual Basic
a collection of bitmap routines in visual basic
A College Library Management Software in Visual Basic
a colorpicker that uses websafe colors. in visual basic
A Complete Calculator in Visual Basic
a complete mmorpg engine - vbgore v1.0.0
A complete mmorpg engine - vbGORE v1.0.0 in Visual Basic
A Complete Simple Banking Application in Visual Basic
a cool calculator in visual basic
a custom color picker for easy integration in visual basic
a custom command line interpreter in visual basic
a daily alarm class in visual basic
a database toolkit for ms access in visual basic
a db-less personal expense management system in visual basic
a dbase iv module with an export function in visual basic
a demo on how to build a coolbar in visual basic
a demonstration of the circle draw method in vb6
A Fast Fill FlexGrid by Recordset ADO in Visual Basic
a fast method for appending strings in visual basic
a fast syntax highlighting control in visual basic
a feature rich custom combobox in visual basic
a firebird 2.0 data access layer with vb.net
a fully featured winxp-styled lcd alarm clock in visual basic
a function that can calculate isbn checksums. in visual basic