Visual Basic Code Source - Welcome!
Welcome to my Visual Basic Code Source website. This site is devoted to most all Visual Basic languages. There is a broad range of "Free and Unique" source code, examples, class libraries, controls, links, and other resources for Visual Basic 5.0/6.0, Visual Basic.NET 2002/2003, and Visual Basic 2005 - 2008.
|
Popular - Visual Basic Examples
|
Address Book Database- A simple address book example using a database
Autocomplete Capabilities- Add autocomplete features to textbox and combbox controls
Calculator Example- A simple example of making a small calculator program with basic features
CD Class Module with Example v2.1- A class for playing cd audio disks and a example on how to use it
Change Windows Desktop Wallpaper- An example of how to set the desktop wallpaper to a custom wallpaper
Check if a File or Directory Exists- A example that uses the Dir function and FileSystemObject to see whether a file or folder exists
CPU Usage Example- Uses the GetSystemTimes APi call added in XP Service Pack1 to calculate the cpu's usage
MP3 Player Examples- There are examples for playing MP3,Wave,WMA files using MCISendstring library and windows media player control
Shutdown, Restart, Log Off Example - A example of using the ExitWindowsEx API or Shell to restart, shutdown, loggoff Windows XP/Vista
Timing Examples- some examples of using the GetTickCount/timeGetTime, and the QueryPerformanceCounter API for High Resolution timing
|
Latest Site News - 2008, September 21st
-
September 21st 08 - A new application called: csComputerInfoTool v1.2 - The Vista Edition has been added under the software section. The example is under the VB.NET 2005/2008 - Examples page. This app uses the registry, performance counters, Windows Management Instrumentation (WMI), and the .NET Framework to get alot of various info on the computers cpu/processor, motherboard, video card, memory/ram, c: hard drive, and the Windows OS. The tool was made with Microsoft Vista in mind but it may work fine in Windows XP. Some features or problems could pop up though. IF you just want the example then the OS shouldn't matter unless a feature is not available in the older operating systems.
-
August 5th 08 - A basic .NET 05/08 example has been added on how to get some lower level volume information about a hard drive or other disk drive. It uses the GetVolumeInformation API which returns the volumes serial number, filesystem, maximum supported characters and such. Located on the VB.NET - Examples page under the VB 2005/2008 section. While this API does return a unique serial number when querying a hard disk drive, it is the serial number for the Volume and NOT the actual Manufactors serial number given to the harddrive. To get that you can use WMI (Windows Management Instrumentation) which 'should' give you the true serial number value for the harddisk. An example will be added soon. The WMI class you want to use is: "Win32_PhysicalMedia" and the property to use is: " SerialNumber". Just in case you wanted to know. :)
-
July 15th 08 - I added a new example for VB 2005 and/or VB 2008 on how to play movies and videos on your windows desktop. I also included code on how to set the transparency/opacity level for the movie window so you can see what is behind the screen only. I didn't include any position or resizing code since this simple example focuses on basic playing of videos and movies while setting the desktop as the parent for the movies window screen. The older csMovieLibrary for .NET has all of those features though if you want them and includes Much more as well (So does the VB 6 based Movie Module class library). While this project won't open in Pre-2005 ide's, the codes in this example should be compatible with 02/03 versions with just some minor code changes. Even VB6 can use the codes with code changes. I may include a example for VB 6 in the future though. I guess its also worth mentioning that this app plays most all of the popular movie formats including the normal .avi, .mpg, .mpeg, .wmv extensions. But it can play mpeg4 divx, apples quicktime mov, and many others as long as the codec for that format is installed. Thats all for now!
-
May 8th 08 - Another example for VB.NET 2005 and 2008 has been added that shows how to use the System.Collections.Specialized.StringDictionary class to store pairs of strings in a collection. IT shows how to add, remove, count, find/search for items and more. This String Dictionary example is on the Visual Basic .NET - Examples page near the bottom under the 2005/2008 area.
-
May 7th 08 - A new class has been added called csAudioCD Library v2.5 - The Professional and Enhanced Edition for VB 2005 and VB 2008. This is the ultimate class library made with Visual Basic 2005 to make a very feature rich audio CD player based application. There are over 50 features available and are very easy to understand and use. Most all of the subs/functions/propertys are fully XML commented with descriptions and explanations. It of course has your basic play/stop/pause features but some of the other features include opening and closing the CDRom and/or DVDRom drive, auto-scan the computer for available CD/DVD drives and can detect whether a CD Disk is in the drive and see if its a audio cd or not. IT can return some useful info about the CD and about the tracks on the CD's. Has available different time-format features as well for getting the length and playing position for both the audio CD and the
Tracks for the CD. Way to many features to list here. A example application has also been added that shows how to use this library and implement some of its features. The compiled class by itself is on the VB.NET - Controls page and the Example application which already includes the compiled class .dll is available on the VB.NET - Examples page under the Visual Basic 2005 and Visual Basic 2008 section. I might release the source code to the class library soon. Have Fun!
-
April 6th 08 - There were two new examples added to the site. One is for Classic VB and the other is for VB.NET. They are both on how to hide or show the caret (blinking cursor) for a textbox and combobox control using the HideCaret and ShowCaret API calls. Remember that the control whose caret you want to hide/show Must be the owner of the caret at the time of calling these APIs. Also when the control loses ownership of the caret it will reset the caret and you will have to call the HideCaret API call again. But if you want the caret (blinking, flashing; cursor or whatever you want to call it) to stay hidden try putting the HideCaret code in the controls GotFocus event. Which whenever the control gets focus, it will hide the caret from the user even if another control temorary gets ownership.
-
March 24th 08 - Another example for VB.NET was added as well. This example uses the LinkLabel control to mimick a real webpage link. The control will look and act like a common link on a webpage. When the link is clicked, it will open the default webbrowser application and load the address specified in the LinkData property of the control. Compatible with all .NET VBs including Visual Basic 2005 and 2008.
-
March 24th 08 - A new example for VB.NET has been added named Ultimate Textbox Manipulating. As the name entails it shows how to do Many things with the standard textbox control. Some of the codes are: searching, selecting text, page right/left, line right/left, page up/down, line up/down, getting line and character information, along with cut/copy/paste and adding, replacing, selecting text. Check out the example or the screenshot to see what all is available.
-
March 8th 08 - If the .info download server is down, you can replace .info with .org to try and get the download. Example: http://www.vbcodesource.info/myDownload.zip can be changed to: http://www.vbcodesource.org/myDownload.zip. I will try to eventually add a secondary/backup link on all of the website pages like I did on the VB Classic - Examples page.
-
March 8th 08 - A new example for VB.NET has been added that will check a IP, URL, or UNC (Universal Naming Convention) name using the "IsDestinationReachable" Windows API call to see if it is reachable or not. It can return the to and from speed of the network used to try and reach the destination along with the type of network available. This can somewhat be considered a pinging example in a sense but you wouldn't get accurate reply times since the API will also get the Network type and the To/From speed before returning control to your application. But it would be good to see if a specified destination is available or not. VB 05/2008 already has a full Ping class for checking a destination. I would recommend you use that class if using those versions unless you want the network to/from speed or whatnot.
-
March 3rd 08 - I went ahead and changed the download links to point to my www.vbcodesource.info web server. The original .org server is down and I don't have any idea when it will be running again. But anyways, all of the downloads and screenshots SHOULD be working. Please send me a feedback message if there is a download not working.
-
February 19th 08 - A new example for Visual Basic 6.0 and 5.0 has been added on how to get high resolution timing using the QueryPerformanceCounter and QueryPerformanceFrequency API counters. This timer supports sub-millisecond resolutions which is better than timeGetTime and far better than the getTickCount timer. This timer will usually use a 3.6 Mhz clock on the motherboard for timing but sometimes it could use your processors rdtsc counter. Examine the QueryPerformanceFrequency returned data from its ByRef parameter to see what the ticks per second of the timer is. If the function returns a 0 then the computer does Not support the timer or you did NOT pass the APIs parameter ByRef(By Reference) which is Required. Do Not pass the parameters for these two (2) QueryPerformance APIs ByVal(By Value) because they WILL fail. You Must pass them ByRef. IF you need very precise timing, then this counter should be the way to go.
-
February 18th 08 - Another example for Visual Basic.NET 2002/2003 and compatible with VB 2005/2008 has been added. This example shows how to perform basic Math calculations using string variables/objects. It shows the Addition, Subtraction, Multiplication, and Division based operators. The main purpose I guess is how to perform Math operations on Strings in a somewhat safer way. It basically uses the Val() Function which will examine a string and if the string is a number or if the string starts with a number then it will convert a object/string to a double or a Char to a integer type. IF the string contains no number or doesn't begin with a number then it will simply return a 0 which will keep your application from throwing a improper casting error message and/or crashing. A VB 6.0 version may be put up soon.
-
February 17th 08 - A small example made with Visual Basic.NET has been added that shows how to use delegates and callbacks to create and use a higher resolution windows based API Event Timer. This example uses the timeSetEvent/timeKillEvent APIs which supports much higher resolutions than the original SetTimer/KillTimer APIs at about 1 milli seconds compared to 15-16ms. This timer is actually a part of the winmm.dll multi-media library that has most of the multi-media based apis like the Playsound and mciSendString apis. Anyways, its located in the .NET - Examples page.
-
February 8th 08 - The example on how to Clear All Textboxes, Manipulate or Set properties for all conrols on a form has been updated. The update has new codes that shows how to skip over or bypass controls specified in the code and clear or set the rest of the controls that are Not specified to skip.
-
January 29th 08 - I added a new Control I made with C++ with _stdcall exports so it can be used by Visual Basic under the .NET - Controls page. The control will return some various basic cpu info like the model, vendor, stepping, clockspeed, ect... A example on how to use the library made with VB.NET 2002/2003 and compatible with Visual Basic 2005/2008 has been added to the .NET - Examples page.
-
January 28th 08 - I meant to post this along time ago but forgot too. Microsoft now has available all of the Visual Studio.NET 2008 Examples that were included with the RTM (Released To Manufacture) versions as a seperate download. There are actually very MANY examples available for Visual Basic 2008 that covers everything from Excel, Powerpoint to LINQ, Tablet Based Programming, Server based, and Database programming. While the examples may NOT open with VB 2005, the codes in many of the examples should work with Visual Basic 2005 as well. Obviously examples like LINQ based source code won't work with .NET 2005 since LINQ was not supported until VS 2008. Anyways, Click this Link if your interested. The download is alittle more than 9 MB, so if you have Dial-Up it may take awhile. :)
-
January 24th 08 - An example for Visual Basic.NET has been added that shows how to get the Textbox Controls - current line number (#) in VB.NET 2002/2003 (The VB 2005 and VB 2008 Textbox has a feature for this, but is Not in this example. Might add later), getting the total numbers of lines in the textbox, and getting the text/characters at the current line position.
-
January 16th 08 - I added Two (2x) new Examples for Visual Basic 6.0 (Codes should be usable in 5.0). Both examples are related to using two of the available system timers/counters. Since I have a few timer related examples for vb.net, I figured I would do the same for VB Classic. So one of these examples uses the GetTickCount API Function and the other example uses the timeGetTime API Function along with the timeBeginPeriod and timeEndPeriod API calls. The GetTickCount timer/counter supports about 15 ms resolutions, while the timeGetTime counter/timer
supports up to 1 millisecond resolutions. Go to the VB - Examples page under Timing to check out the examples. I might make 1 or 2 more Timing related examples for the VB.COM (5.0/6.0) versions using a Very High sub-millisecond Resolution performance counter-timer(QueryPerformanceCounter) and possibly another on a super high resolution timer(RDSC).
-
January 5th 08 - A example for VB.NET 2003 (2002 as well) and compatible with VB 2005, Visual Basic 2008 has been added. The example is how to do some basic Form/Application effects using API codes. Some of the animations is a Left to Right, Right to Left, Top to Bottom, and Bottom to Top directional effects. Some special effects is Blend, Roll, and Slide. You can also specify how fast or slow the effect will take place. At the .NET - Examples page.
-
December 31st 07 - A new Class Library named csCPUFeatures Library 1.0 and a Example on using the class control with VB.NET is available as well. This library uses the IsProcessorFeaturePresent API call and will let you know if the CPU supports 3DNow!, SSE, SSE2, RDSC, Intel FPU Bug, MMX, and more. The source code and compiled class is under the DotNET - Controls page, and the example made with Visual Basic.NET is under the .NET - Examples page.
-
December 29th 07 - Two(2) new examples has been added, one for VB 5.0 and VB 6.0, and the other is for Visual Basic.NET. Both examples show how to change/set or manipulate all controls on a form without having to specifically write code for each of the controls. The examples will automatically go through each control on the form and Clear all Textbox controls and will also checkmark all checkbox type controls. Much easier and alot less code than if you manually set each of the controls properties!
-
December 28th 07 - A new example compatible with Visual Basic.NET through to Visual Basic 2008 has been added that shows how to display a Inputbox and setting the Input/Textbox to display as Password Characters. Its just like when you set a textbox controls passwordChar property to display astericks characters in place of the actual password characters. IT uses Subclassing and Window APIs like FindWindow, GetWindow, and SendMessage Functions. Under the VB.NET - Examples page.
-
December 27th 07 - Added a new program and example called csNotePadX 1.0 and it is supposed to be a better windows notepad. It is built around the textbox control and has every feature the windows notepad has and more. Has full printing, print preview, page setup support along with simple and advanced find/search and replace features. There is character casing, character alignment, and Font support as well. Under the Visual Basic.NET 2005/2008 - Example section.
-
December 24th 07 - A new v2.0 update to the csBrowserPlus Webbrowser Example for VB 2005 and Visual Basic 2008 has be posted. A major feature added from the v2.0 update is adding/editing/deleting your own custom favorites menu and will load and save on application load and exit. IT will dynamically create menu items under the favorites menu with the url as the title/text for each favorite you want to add. Check out the screenshot to see what I mean. There are a few other minor features as well, like selecting all/none text, open a new csBrowserPlus Window Clone or a default browser window like Internet Example or whatnot. Located on the: Visual Basic.NET - Examples page under the VB 05/08 section near the bottom of the page.
-
December 22nd 07 - All of the downloads should now be working. If you find any downloads or screenshots that aren't working then please send me a message. Sorry for the downloading troubles :)
-
December 22nd 07 - Unfortunately, it appears that my downloads server is down. Evidentally since 11 a.m. Eastern time. IT is 5:15 Eastern time now. 6 hours is quite along time. I am trying to get it straightened out, so please try coming back later and hopefully the downloads will be working.
-
December 21st 07 - I added a new example for Visual Basic.NET that shows how to perform Yahoo Searches from your Application and display the results with various info related to the search and to the returned websites. The example uses the Yahoo Search Service that allows many different search features like local, web, image, video searching and more. This example has the Yahoo.API class included but you should goto this yahoo page and download the Search SDK. The SDK includes a full example of performing all of the available search features. You might have to sign up for a developer account to download the sdk? I hope you find this example and information interesting :)
-
December 15th 07 - I've now added a basic calulator example for Visual Basic 2005 and Visual Basic 2008. IT has your basic Addition, Subtraction, Multiplication, and Division features. Some more features are Sign changing, Number Reciprocal, Round Values, Backspace, Clear, and more. The example is in the Visual Basic.NET - Examples section under VB 2005/VB2008.
-
December 14th 07 - The original Visual Basic 5.0 and VB 6.0 calculator example has been updated to v1.1. The 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. If you pressed 3, then it would read 23. This update fixes that problem and will start a fresh calculation before adding the pressed number. A new 'Calculator' Example compatible with Visual Basic 2005 and Visual Basic 2008 will be added shortly.
-
December 12th 07 - A new example has been added for Visual Basic 5.0 and Visual Basic 6.0. The example shows how to use some Windows APIs like: SetWindowRgn, CreateEllipticRgn, CreateRoundRectRgn, CreateRectRgn to create custom/abnormal shaped forms. The example sets the form as a Circle, Ellipse, and Rectangle using these API calls. In the VB Classic - Examples section.
-
December 6th 07 - A new example for Visual Basic 5.0 and Visual Basic 6.0 has been added that shows how to get the computers total cpu/processor usage percentage using the GetSystemTimes API call. The example gets the user time, kernel time, and idle time values from GetSystemTimes() and calculates those values as a percent value. The usage is based on ALL of the computers processor's and not just one of them. If you have 2x CPU's or Cores it will be the total across BOTH processors. Ex: If CPU/Core #1 is 100% percent usage and CPU/Core #2 is at 0% percent usage the total usage percentage would be 50%. Also the GetSystemTimes() API is not available until Windows XP with Service Pack 1 and above. Windows Vista and Windows Server 2003 and above is supported as well. I already have a example for Visual Basic.NET if you use VB.NET.
-
|
|
FREE - Visual Basic 2005 Express Edition Download |
|
|
If your interested in Visual Basic 2008, Click Here to download the Free IDE |
|
|
VB 2005 Keyboard Shortcut Poster If you want the keyboard poster, Click Here to download. |
| |
|
Our Agreement: By downloading and/or using any of the code or resources from this site, you agree NOT to misuse and/or use for any malicious purpose. You agree NOT to steal or take any of the code with the intent of claiming it to be yours. You are free to use all of the code here in your projects and take bits and pieces of code as you like. Please do not edit or take out the Title, By, Website, Email, Description, or Copyright information that the code may contain. Please do not do anything with this code here that you wouldn't want someone to do to yours. I am not responsible for anything that happens even if your using the codes and resources from this site. |
| |
|