|
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. |
A great thing about Visual Basic is that it easily allows you to use standard windows controls. Once you start to get used to using these controls you will quickly find limitations. One such limitation is that they don't have standard save functionality. This is something that many times you will need to implement in order to retain data the user entered between sessions.
Visual Basic is often seen as a tool to create front end GUI intensive applications. However, it can also easily be used to do lower level tasks such as quickly copying one file to another byte by byte. This code snippet demonstrates how you can easily take one file and copy it to a second one as quickly as possible. The way it does this is by pulling the whole file into memory and then writing it back out to the second file name.
This source sample demonstrates some useful features of VB6, but mostly its just kind of fun. Its a perfect simple sample to implement and show off a little to friends. Once you implement this you will see some cool looking effects on the form. It also demonstrates the For loop construct and a bunch of the properties that you can set on a form including: ScaleMode, Font Name and Size and ForeColor.
Every system has many many fonts on it. Visual Basic allows us access to these fonts through its Screen object. Often getting font information can be very challenging, especially in the past using languages such as C++ or interacting directly through the Win32 API. Visual Basic makes this very easy. The source code below demonstrates this. It also demonstrates how you can use a for loop to loop through all the fonts. Lastly the source code demonstrates using a combo box control.
An often requested task that new developers to VB ask is how can I write a program that will launch other programs. Its fun to create your own little launcher program that does things like allows you to quickly launch just the programs you want. Obviously program launchers already exist out on the market that you could simply use. But one of the great things about learning a programming language like Visual Basic is that you can create your own programs that behave exactly how you want them to.
Below you will find only four lines of code. But these four lines of code allow you to do something that would take hundreds of lines of code using a language such as C++. This source sample demonstrates how you can use Visual Basic's built in property called Screen to grab information about, wouldn't you know it, the screen that your application is running on. What this code does is queries the screen width and height. It then subtracts your forms width and height and divides it by two so you can put it in the middle.
Since Visual Basic has great support for reading and writing to the file system it can be used for things that wern't even popular or around when it was created. A great example of this is MP3 files. This source code sample show how you can read the file information details from an MP3 file and grab any of the tag info from that audio file. The tagging info are things such as Title, Artist, Album, Year, and Custom Comment information. These are set in programs such as iTunes. (E6ZXKMNDB23T)