Visual Basic
Visual Basic.Net
Downloads
Links
Support This Site
Contact
These are examples for the Classic versions of Visual Basic (4.0, 5.0, and 6.0).
| Name | Description | Screenshot | Download |
|---|---|---|---|
| Address Book Database Example | A basic example I made to show you how to create a database program as a address book. This address book example had a minor update that removed some dead code and set the Data Bar controls DatabaseName location to look for the .mdb database file in the project directory. | click here | click here |
| Aol Roombuster | This is a example of a Aol roombuster I made aong time ago. I believe it works with Aol 4.0 and above. |
n/a | click here |
| Audio Level | This is a example from msdn that show the level of the audio playing | n/a | click here |
| Autocomplete Capabilities/Support to Combobox and Textbox Controls | An example of using the SHAutoComplete API to enable textbox and combobox autocomplete capabilities. If you've ever tried to autocomplete comboboxes before and it wouldn't work, its because you need to get the handle to the actual "Edit" window of the control. This example shows how to do that and uses the FindWindowEx API call to get the handle to the combobox edit portion. | click here | click here |
| Calculator Example | This is a example to show how useful control arrays can be making a calculator application.
Version 1.1 Update: This update will now clear a previous calculation instead of adding the pressed number to the calculated value. Example: IF you press 1 + 1 and then the = button, it will display 2. But before this update if you pressed another number it would add to the previous number. Lets say you pressed 3, then it would read 23. This update fixes that problem and will start a fresh calculation before adding the pressed number. |
click here | click here |
| CD Class Module with Example v1.0 | Obsolete Version! - This is a CD player class module I put together with a example. | n/a | click here |
| CD Class Module with Example v2.0 | Obsolete Version! - This is a CD player class module I put together with a example. More features added. | n/a | click here |
| CD Class Module with Example v2.1 | This is the latest CD player class module I put together with a example on making a full-featured cd player application. More features added. Added support for selecting cdrom drive. | click here | click here |
| Change and Set Custom Shaped Forms/Applications | An example of using the SetWindowRgn, CreateEllipticRgn, CreateRoundRectRgn, CreateRectRgn, and CreatePolygonRgn - Windows API Calls. This particular example shows how to create a Round Shaped, Rectangle Shaped, and Elliptic Shaped Form in the application. | click here | click here |
| Change/Set All Controls Settings/Properties on Form | A small example of how to change settings/properties for control of the same type without having to write code for each individual control. Ex: Say you have 5 textbox controls and you want them all to be cleared. You can do them one by one if you want too... But instead create some simple code to automatically go through all textbox controls and clear the textbox controls text without directly writing code for each Textbox. This example shows how to do that and will save lots of coding/time. This example shows how to Clear All Textboxes Text and to Checkmark all Checkbox controls on the form. | click here | click here |
| Change Windows Desktop Wallpaper | A example of how to programmatically change the Windows desktop wallpaper. This example uses the SystemParametersInfo Api to accomplish this. This is similar to the VB.NET example, it had a few lines of code changed to work with VB 5.0 and VB 6.0. | n/a | click here |
| Chr$ Code Converter | This is the source code to the Chr$ code converter I made. | n/a | click here |
| Complete MP3 Player Example | This is source code to a complete MP3 Player I made quite along time ago. I don't know how good the code is. Uses the Windows Media Player. | n/a | click here |
| CPU RDTSC/Calculate CPU ClockSpeed in Realtime | This is a example that returns the processors timestamp tick value and also calculates the speed of the processor in real-time. The dll is included in this download. It uses my csRDTSC.DLL. | click here | click here |
| CPU Usage using GetSystemTimes API | A small example of how to get the computers total cpu usage. This example uses the GetSystemTimes API call and calculates to get the system cpu or processor usage. This API can only be used to get the total cpu usage from ALL of the computers processors. Example, if CPU #1 is 100% usage and CPU #2 is 0% usage the total usage would be 50%. Also, this API call is available in Windows XP if Service PAck 1 or Above is installed. OBviously Vista and the like will have it. | click here | click here |
| Create Controls at Runtime | A simple example of how to create controls at runtime. This example makes a label and commandbutton control when the form loads. | n/a | click here |
| csSoundPlayer Library v1.1 with Example App | This is exactly like the VB.NET version, I just changed some code to make it fully compatible with Visual Basic 5, 6.0. This is a example of how to use the csSoundPlayer Library v1.1 Class in your projects. This Class makes it very easy to add support for playing Waveform sound files. | n/a | click here |
| Download File | Shows you a couple very easy ways to download files from the internet using the url. Uses api, no controls. You can download files, webpages ect.. If someone has right clicking disabled. | n/a | click here |
| Drag and Drop | This example show a way you can fake a drag/drop with listboxes. | n/a | click here |
| Drawing Example | Just a very basic example on how to draw onto a picturebox. Need to move the mouse slowly. Needs improvements. | n/a | click here |
| Environment Variables - Getting/Retrieving Hardware/System Information | This example simply shows how to use the GetEnvironmentVariable API to lookup pre-defined variables and get/retrieve their values. To view some available variables go to Start / Settings and Control Panel and then click on the System icon under the Control Panel. Click on the Advanced tab and click the Environment Variables button which will display a window with the variables and their values. | click here | click here |
| FX.DLL with SDK - Version 1.03 | The FX technology offers you fast, powerful and safe Graphical Device Interface (GDI) based solutions. The FX library is written in Microsoft Visual C++ 6.0 and is designed for the Win32 subsystem. The FX library supports all Windows platforms, except for the historical Windows 3x. For a complete description, click this link | click here | click here |
| Get/Save Settings | Shows you how to use the very useful Get Setting and Save Setting functions in VB 6.0. | n/a | click here |
| Get CPU's RDTSC Value and Calculate Clockspeed | This is a example that returns the processors timestamp tick value and also calculates the speed of the processor in real-time. This is similar to the .NET 2002/2003/2005 example's except that this one is compatible with Visual Basic 6.0. The dll is included in this download. | click here | click here |
| Get the Last Time the User was Active | This is a small example of using the GetLastInputInfo API call, that returns the current tickcount value of when the user was active and if the user is sitting idle, or reading something, or away from the computer and what-not. This example monitors the tickcount value and if the value has changed since the last check, it will display the actual Time of Day the user did something. This API mainly checks for Mouse and Keyboard activity in case you wanted to know. :) | click here | click here |
| Get Low-Level Memory Performance Information Example | A small example of using the GetPerformanceInfo API Function with the PERFORMANCE_INFORMATION structure converted from C++ to VB to get some low-level information about the computers memory based data. Gives you the Total/Available Physical Memory (Ram), Handle Count, Thread Count, Processes, Kernel Related MEmory Data, Commit Charges, System Cache and more. | click here | click here |
| Logon and/or Login a Application with Username and Password Protection | A small example of using both Inputboxes or using a Form to require proper username and password credentials for authorization. A option is available to require case sensitive username and password or non case sensitive. | click here | click here |
| Meta Tag Generator | This is the source to my Meta Tag Maker. | n/a | click here |
| Misc. Windows Information | Uses api to show you how to get some Windows information. Get the Windows Directory, System Directory, Temporary Directory, User name and Computer name. Easier than using the registry to get it. :) | n/a | click here |
| Movie Module with Example | This is a example of using my movie module to play various movie formats. | n/a | click here |
| MP3 Encoder Example | This is great example of encoding a wave file to a mp3 file using a C++ DLL. | n/a | click here |
| MP3 Player | This example shows how to play mp3's with the window media player control | n/a | click here |
| MP3 Player with Module | This example shows how to use my MP3 Class Module for MP3 Music Playing | n/a | click here |
| Music Player with Module v2.2 | This example shows how to use my updated Music Module. | n/a | click here |
| MP3 Tag Editor | This is a example of Reading and Writing MP3 Tags. | n/a | click here |
| Multi-Media Module Example | This is a example of how to use my Multi-Media Module. | n/a | click here |
| OCX Example | This is a great example of how to make a ocx file. This example makes a Aol Command Button. | n/a | click here |
| Load Textfile in Listbox | Shows how you can load a textfile in a listbox. | n/a | click here |
| Network Address Pinging using Fusion | A example of using Fusion which is a VB 2005 comclass wrapper that gives Visual Basic 5.0/6.0 basic Ping capabilities. The wrapper contains 2x Functions available to VB 5/6, one that Pings a Network Address and Returns True or False depending on whether the Ping got a reply from the url. The other function is similar to the first except it will return the time it took to get the reply from the url (RoundTripTime). This project includes a Bin directory with the .TLB and .DLL .net files. The source code to the Fusion Wrapper is located under the Visual Basic.NET - Controls sections. The .NETFramework needs to be installed on the target computer for Fusion to work. | click here | click here |
| Play Wave File | This is a example from msdn that plays a wave file. | n/a | click here |
| Search Listbox | A example on how to search a listbox or combobox. Shows you two methods. | n/a | click here |
| Shutdown, Restart, and Log Off ALL versions of Windows (XP too) using ExitWindowsEX API - VB5/VB6 | A short, sweet, and simple example of using the ExitWindowsEx API to Shutdown, Restart, and Log Off Windows INCLUDING Windows 2000/XP, and should work with Vista as well. If you've ever had the problem of ExitWindowsEx not working with Windows 2000/XP and above then check out this example to see Why :) The short answer is you need to adjust your application token to give it the proper priviledges before Windows will respond. | click here | click here |
| Shutdown, Restart, Log Off - Windows XP | This is a example of how to Shutdown, Restart, and Log Off Windows XP using code. This uses Shell and NO API. It works very well. I only tested the Shutdown code but the others should work just fine. | click here | click here |
| Timing - Standard Resolution using GetTickCount | A example of using the GetTickCount() API function to time Visual Basic code. There are obviously other reasons for using the counter as well. But anyways, this timer has a resolution of about 15-16 milli-seconds but should Not use all that many resources. This example shows how to get the timers resolution and to see how long it takes to complete some looping based code. | click here | click here |
| Timing - Better Resolution using timeGetTime | A example of using the timeGetTime API function to time Visual Basic code. It also uses the timeBeginPeriod and timeEndPeriod APIs to specify the resolution to set the counter too. This counter/timer supports up to 1 milli-second resolutions which is Much higher and more accurate compared to the GetTickCount counter. Depending on what you will use the timer for, it may use more resources than the less accurate GetTickCount timer. The extent is probably very low, especially if you are not using the timer all that much. This example shows how to get the timers resolution and to see how long it takes to complete some looping based code. | click here | click here |
| Timing - High Resolution using QueryPerformanceCounter/QueryPerformanceFrequency | This is a basic example of how to get much higher resolution timing using the QueryPerformanceCounter and QueryPerformanceFrequency API calls. This counter supports sub-millisecond resolutions so it is obviously more precise than the getTickCount and timeGetTime API timers. Most of the time this counter/timer will try to use a clock on the computers motherboard which is usually about 3.6mhz. But sometimes this timer will use the CPUs actual RDTSC Counter which will obviously be even better resolutions. Simply call the QueryPerformanceFrequency api and examine the Byref parameter value to see what the counts are per second to determine which timer is used. 3579545 tps (ticksPerSecond) is the most likely value. IF a 0 is returned then the computer most likely does NOT support this timer/counter or the API calls parameter is not passed Byref which is what this API requires. Do NOT pass these 2x QueryPerformance API parameters ByVal (By Value). They will fail if you do. MUST be passed ByRef (By Reference) since the API will be PUTTING data IN the parameters and NOT getting data from the parameters. :) | click here | click here |
| Tone Generator | Example of how to generate tones with different frequencys and durations. Could be good for morse code. | n/a | click here |
| Using Modules | This is a example I put together to show how to use a bas file. | n/a | click here |
| Volume Example | This is a example from msdn that show how to control the volume bar. | n/a | click here |