1. Home
  2. Computing & Technology
  3. Visual Basic

"How to do it" Programming Techniques for Visual Basic .NET

You will find problem solving articles here that walk you through the new ways of programming VB.NET. Make better use of the .NET Framework and the growing world of .NET objects.
Word Application Automation / Date and Time Calculation Using Bookmarks in VB
This program uses VB.NET and Word to complete a Word document with date calculations. In my "other" life, I'm a writer. I was recently thinking about books such as 1984 and 2001: A Space Odyssey that have been bypassed by the march of time. The idea of using Visual Basic to write an "eternal" story that would always be current came to me, so I wrtote the story and a program to update dates and times in it using bookmarks. The program uses WPF - Windows Presentation Foundation - as the GUI.
Have you had problems using Application Settings in VB.NET? Does the …
I've seen a lot of questions about using the Application Settings in VB.NET, especially the Synchronize button in Project Properties. Readers respond about the problems they have had.
Do you use the SQL or traditional dot notation to code LINQ?
The SQL query nototation and the dot notation are equivalent ways to express a LINQ query. Which one do you use?
LINQ Queries - An Example Driven Introduction
LINQ - Language Integrated Query - is the reason a whole host of new technolgies were introduced in VB.NET 2008. For example, Lamda expressions and partial methods. Another technology that was introduced with LINQ is the LINQ query ... a faster and more direct way to write LINQ query expressions. This article explains it.
Partial Methods
Partial Methods are one of the techniques introduced with .NET Framework 3.0. They're used in LINQ to SQL, but you can use them anywhere they work for you. This article shows you how.
Using Extension Methods in VB.NET
A normal class has to be instantiated as an object before the methods in it can be used. But if a method is shared, then the class it's in doesn't have to be instantiated. The method can be used directly. What if you need both? Then you need a feature introduced in VB.NET 2008 called extension methods. This Quick Tip tells you how that works.
Using VB.NET To Code The VB6 ItemData Property
ItemData is one of the many features of VB6 that was dropped in the move to VB.NET. It wasn't as popular as the VB6 Control Array feature, but a lot of people liked it. Peter wrote in to ask how to do the same thing in VB.NET. The answer has a lot more to do with Classes, Structures, and Object Oriented Programming than ItemData. This article explains what that means.
Hashtable and Performance
Are you curious about what the Capacity and Loadfactor parameters will actually do for Hashtable performance in a Visual Basic .NET program? This article explains all of the parameters you can pass to Hashtable and benchmarks the result. It's a good example showing how to use Stopwatch and VB.NET XML as well.
VB 2010 and Beyond
If you're interested in what the next version of VB.NET will look like, this article that summarizes a presentation given by two people at Microsoft who know best, Anders Hejlsberg and VB Program Manager Jonathan Aneja, will give you a good idea.
Small Basic - A New Language for New Programmers from Microsoft
If you've tried Visual Basic .NET Express and you're still confused, Microsoft now has a new version of Visual Basic that's even easier than that to get started with. It's called Small Basic and it only has 15 keywords in the current version. About Visual Basic reviews the 0.5 version and tells you how to get started using it.
AutoTest - A LINQ to XML Example Program
Microsoft's LINQ technology combined with XML can revolutionize the way you program, but it's difficult to make the transition from more traditional ways of programming to LINQ. Moving to XML can be a challenge too. A reader asked for help programming a system to generate random test questions. Since it seemed like an ideal way to showcase LINQ, I wrote most of the code as a programming example.
Partial Classes in VB.NET
Partial Classes were introduced with VB.NET 2005 (Framework 2.0) and are used in a lot of different ways in VB.NET, including ASP.NET and Windows Forms. This article explains what they are and why they're useful, including how to hide them in Visual Studio Solution Explorer. Tested in both VB 2005 and VB 2008.
MustInherit and NotInheritable in VB.NET
You can create an object in Visual Basic .NET that can't be directly instantiated and you can create an object that can only be instantiated. These two restrictions are called MustInherit and NotInheritable. This article explains how they work and why you should use them.
An Introduction to Programming a VB.NET Control With Inheritance
You can build a VB.NET control that has many of the advantages of a toolbox component without much effort. This article is a great "getting started" project that will teach you a lot about how classes and inheritance in the VB.NET works.
COM - .NET Interoperability in Visual Basic
There are still plenty of reasons to use COM, Microsoft's Component Object Model architecture, in .NET. This article walks through a program that updates an Excel 2007 spreadsheet using Visual Basic .NET 2008 Express.
Disposing Objects
Disposing an object is something that you won't have to worry about in VB.NET very often. .NET includes a technology called Garbage Collection that usually takes care of everything silently and efficiently. But occasionally, usually when using file streams, sql objects or graphics (GDI+) objects, you may need to take control of disposing objects in your own code. Or, you might write your own class that implements the IDisposable interface. This article gives you some useful advice.
.NET - COM Interoperability in Visual Basic
There are still plenty of reasons to use COM, the Component Object Model architecture that was the heart of Microsoft's technology back in VB6 days. This is the second article in a series. The first walks through a program that updates an Excel 2007 spreadsheet using Visual Basic .NET 2008 Express. This article shows how to go the other way and access a .NET Linq object from a VB6 program.
COM - .NET Interoperability in Visual Basic
There are still plenty of reasons to use COM, Microsoft's Component Object Model architecture, in .NET. This article walks through a program that updates an Excel 2007 spreadsheet using Visual Basic .NET 2008 Express.
Nullable Types Gives Visual Basic the Ability to Say Nothing
In .NET 2.0, value types, such as Integer or Boolean, gained the ability to be "nullable". That is, you could give them a value of nothing. Reference types have always had this capability. This article explains what a nullable type is, and how to use it.
Getting Started With Lamda Expressions in VB.NET 2008
Lambda expressions are new in VB.NET 2008 (VB9) and they have a reputation as being really difficult, partly because of the name. In fact, getting started with lamda expressions is really easy. This article shows you what they are.
The Useful Generic List in VB.NET
The most useful "generics" objects in VB.NET are in the System.Collections.Generic namespace. And the most useful class in that namespace is the List class. This article extends a previous article about Generics and has examples and explanations of the ForEach, FindAll, and Sort methods in Visual Basic .NET.
Using Delegates in Visual Basic .NET for Runtime Flexibility
Delegates are used in VB.NET to "allow a function to be invoked indirectly by way of a reference to the function." They're a key part of the way events are triggered in VB.NET and give you runtime flexibilty. This article explains more about what they are and how to use them.
VB.NET Resource Files
VB.NET resource files allow you to make objects like graphic files, strings, and icons available to your code and be included as part of the project. A resource file is integrated directly into your Visual Basic project for maximum execution speed and minimum hassle packaging and deploying your application. This article tells just how to use them in VB.NET.
Using TableLayoutPanel and FlowLayoutPanel in VB.NET Windows Programming
The ability to design your application interface was given a huge boost when Microsoft intoduced the two new controls TableLayoutPanel and FlowLayoutPanel in Framework 2.0. Using these controls, you can create forms where the other controls, like Textbox and Listbox, stay right where you want them to be. And you can even get autosizing effects that were previously only available with third party purchased controls. This article shows you how to get the most from these controls.
Use a database instead of a sequential file
A lot of programmers still use a sequential file when they need to save and retrieve data in a Visual Basic program. There are a lot of better alternatives, however. Free programming tools from Microsoft make it easy to use a database rather than a sequential file. And the new SQL Server Compact 3.5 database files make it even easier. This article shows you how it's done.
All About Serializing in Visual Basic
If you need to save everything in a class, structure, or collection for use later on, then serialization is the way to go. In addition to straight-on serialization to a file, this article also shows you how to implement custom serialization where the serializing class does custom processing while it's serializing.
Understand and Program Checksums with Visual Basic
Checksum is a method or finding, and sometimes fixing, errors in files, message packets, strings, or any set of bits that has to be accurate. It's used most often in data communications where getting a bit scrambled here and there happens a lot. In my survey of all that is out there for you to read about it, it seemed to me that what was missing was a basic explanation of what a checksum actually is. That's what this article is all about.
Special Directories and System Directories in VB.NET
.NET, and in particular, Visual Basic, provide extra help for discovering information about Special Directories in the (exclusive to VB.NET) My namespace. But not everything you might want to know about is there. This article shows you what's missing, and how to find that using the Environment namespace.
Windows Presentation Foundation (WPF) Layout and VB Code
WPF is very different from Windows Forms, in part because things are drawn on the output in a way that can make your code fail in unexpected ways. This short article describes how this can happen when WPF has failed to calculate the Width and Height properties during the layout and what to do about it.
How to create 2D Graphics using WPF for Visual Basic Programmers
For many years, GDI+ has been the graphic foundation of Microsoft technology. Today, there's a new technology, WPF - Windows Presentation Foundation. WPF is usually thought of as a replacement for Windows Forms, but there's actually a powerful graphics part of it that also replaces GDI+. This article explains it.
Part 6: TripPlanner - A Complete WPF and XAML in Visual Basic
An introduction for VB programmers to WPF - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - can be found in part 1 of this series. All the elements for a complete application have been demonstrated. In the conclusion to the series, a complete application that save trip planning information in an XML file is demonstrated.
Part 5: A First Introduction to WPF and XAML for Visual Basic Programmers
An introduction for VB programmers to WPF - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - can be found in part 1 of this series. The XAML code is hooked up to a VB.NET a code file using the new WPF routed events model in this tutorial.
Part 4: A First Introduction to WPF and XAML for Visual Basic Programmers
An introduction for VB programmers to WPF - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - can be found in part 1 of this series. Data binding is a new capability in WPF and XAML. This article shows how to do it.
Part 3: A First Introduction to WPF and XAML for Visual Basic Programmmers
An introduction for VB programmers to WPF - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - can be found in part I of this series. A WPF application coded entirely in XAML is developed in this part of the series.
How to use the System.Drawing.Printing components in VB.NET
VB.NET's has direct and easy to use support for printing. This short article explains how it's done uisng the System.Drawing.Printing namespace. In addition, if you run into an InvalidPrinterException in Windows XP or a AccessViolationException in Vista, you might want to see how I got around it here.
ImageList: Project a Good Image When Using VB.NET
The ImageList control has been a feature of Visual Basic since VB6 days. But most people don't use it, probably because it's just not clear to many programmers what the ImageList will do. This article explains it.
How to use Process.Start in Visual Basic .NET
Process.Start is the .NET way to start another program executing in Visual Basic .NET. It's a lot different than the Shell command that was used in VB6. This article shows you the in's and out's of using Process.Start.
How to use random numbers in Visual Basic .NET programs
Microsoft provides good support for random numbers in Visual Basic .NET. The problem, as in so many other things, is in understanding the documentation they provide. This article interprets their pages and consolidates all the common ways of creating random numbers into one article for you.
Namespaces in VB.NET
Namespaces keep Visual Basic .NET organized. .NET by itself is huge and the names of individual software objects frequently overlap. Add in the code that all of the .NET programmers write and you have a giant pot of names that would be chaos if there wasn't a way to organize it and keep one software object from interfering with another. The way it's done is namespaces. This article explains what they are and how to use them.
Two new ways to use If in Visual Basic .NET 2008
The If operator has two new forms in Visual Basic .NET 2008. They're related to the IIF function that has been in VB.NET all along, but they add an interesting twist to make your code simpler and more bulletproof.
IEnumerable and IEnumerator Explained in Language You Understand
IEnumerable and IEnumerator are frequently tossed into technical articles these days. That's because this technique forms a core element of .NET technology. Unfortunately, the articles don't say a thing about what they do. This article, written in the 'from the ground up' style, fills in that missing explanation.
Learning to use structures by coding one for complex numbers
A structure in Visual Basic .NET can be used a lot like a class. This article includes code from Tim Patrick's Visual Basic Cookbook as an excellent guide to the understanding how to code and use structures as well as how to overload operators and even some example string manipulation code.
Learn About the ContextMenuStrip Visual Basic Control
The ContextMenuStrip Visual Basic control is an little known example of the new generation of controls available in Visual Basic .NET. This article is a complete explanation to help you learn to use it.
Part 2: A First Introduction to WPF and XAML for Visual Basic Programmmers
An introduction for VB programmers to WPF - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - can be found in part I of this two part article. In this part, the key concept of XAML namespaces is explained.
A Two Form Example Program
A reader asked for help adding a month to the date entered into a TextBox. But the answer I came up with involved using Select Case to control RadioButton processing, using the DateTimePicker component, and something new about the difference between Show and ShowDialog. It was a good example to show how to raise a custom event too. This article explains the details.
A First Introduction to WPF for Visual Basic Programmmers
WPF and XAML - Windows Presentation Foundation - and XAML - Extensible Application Markup Language - are an entirely new way to create application interfaces that were introduced with Windows Vista and Framework 3.0. Most references approach the subject from the XAML and WPF point of view. Here's one written for the Visual Basic programmer that starts at the beginning.
An Example Program for String Processing
This article has two goals. First, to Illustrate programming techniques like OpenfileDialog and SaveFileDialog, the new .NET StringBuilder object, and how to use RegEx (Regular Expressions). The second goal is to provide a handy file scanning utility to display text strings inside any file.
Simple File Processing and VB.NET
There are a lot of ways to process simple files in VB.NET. The problem is that there are too many, and most references drown you with detail about all of the features of just one specific way. This article takes a different approach. All of the ways to do simple file processing are presented at a summary level so you can see what's available and take your pick. The methods presented range from legacy objects like LineInput to serialization, TextFieldParser, and LINQ to XML.
The IComparable Interface: An Intro Using a Custom Sort
.NET introduced some serious improvements for timing things with the new StopWatch object and improvements in dates and times. But how all this works together, and in relation to each other is one of those dark, musty corners of .NET. This article clears out some of the cobwebs.
Of Ticks and Timers
.NET introduced some serious improvements for timing things with the new StopWatch object and improvements in dates and times. But how all this works together, and in relation to each other is one of those dark, musty corners of .NET. This article clears out some of the cobwebs.
A BCD Clock Program
BCD is an acronym for Binary Coded Decimal. A BCD clock shows the time as a series of six columns where each column is a binary number. When the each binary number is converted into a decimal digit, it tells you the time. This short article shows how to write a VB.NET program to do the same thing.
Bitwise Operations in VB.NET
VB.NET doesn't support bit level operations directly. Framework 1.1 (VB.NET 2003) introduced bit shift operators (<< and >>), but no general purpose way to manipulate individual bits is available. This article shows how to do it.
Compiling Regular Expressions
Regular Expressions are a language that stands by itself. You can use essentially the same regular expressions in a lot of different languages including VB.NET. That's "essentially" because they're not exactly the same. The only comparable language is SQL since most languages have a way of using an essentially similar version. VB.NET, however, goes one step further and allows you to compile a RegEx. This article explains how to do it.
Chars and Codes - All About Encoding
Encoding is the way characters, such as 'A' and '123', but also including symbols and characters from all languages, are saved in Visual Basic and in other languages. Encoding isn't strictly a Visual Basic technology. It's one that allows VB to work with the same data used by any other language. This article explains more.
RichTextBox - It's Not Your Father's TextBox
The RichTextBox is more than just a TextBox with more properties and methods. It's a different way of using text. That's because the Rich Text standard is much more than just text. This article explains rich text and how to solve a reader's question using a RichTextBox component.
StringBuilder ... A New Object in .NET
StringBuilder solves a problem of efficient code that Visual Basic 6 used to have. This article shows you what StringBuilder is, how to use it, and how much faster it really is. If you need help using StopWatch or TimeSpan, there's a good example of that code here too.
Create Forms in Any Shape!
Here's a way to give your VB.NET application a completely unique look and feel. Create a form for your application in a custom shape. It's relatively straightforward to do. This article shows you how.
Bug Reporting to Microsoft - A Continuing Story
While writing an article for the About Visual Basic page, I ran into what seems to me to be a very clear-cut bug in Visual Studio. Since Visual Studio is a pretty good product, I hadn't encountered a bug as definite and clear as this one before, so I figured out how to report it to Microsoft. This article tells what happened after that.
Focus and Select
Focus and Select are methods available in Visual Basic .NET that seem to be completely identical. This article explores whether they really are identical, and if not, what differences exist.
Changing Properties "On The Fly"
Properties don't have to stay the same in VB. You knew that, of course, because Text is a property that you change frequently in program source. But you can expand the flexibility of your programming by finding and changing properties of all controls.
Operator Overloading
It's possible to define totally new ways to use most of the fundamental VB.NET operators such as addition ("+") or subtraction ("-") so they do what you need them to do with your own objects. This article shows you how it's done.
Enum - A Building Block of Visual Basic
The Enum is a fundamental part of Visual Basic that dates back to before VB.NET. This article shows you what it is and how to use it in programs.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article answers a reader's question about how to use GDI+ to draw and control a circle of other circles.
Create Your Own Custom Form Object
Using Inherited Forms and the Inheritance Picker in VB.NET is a great way to increase your productivity if you need several forms in your project that are similar, but not quite the same. This example also shows you how to override event code for components, like buttons or text boxes in the inherited form.
Modules, Structures, and Classes
There are just three coding structures for objects that you can use in VB.NET projects: modules, structures, and classes. This article explains the fundamentals of what they are and how to use them.
Templates for New Projects and New Items
You can add your own custom project templates and new item templates into Visual Studio. If there are local standards, special requirements, or just programming styles that you like to use, you can start out with part of your work already done by creating a custom template. This article shows you how.
Programming the Registry using VB 6 and VB.NET
The Windows Registry continues to be used for a wide variety of critical information. Learn what it's for and how to use it in VB 6 and VB.NET programming.
Coding New Instances of Objects
The concept of an object "instance" is a key part of OOP. But coding a new object instance has several optional variations. Some options make a difference in what you code does but others don't even matter. This article sorts through all the options and explains how the VB.NET New keyword works.
"Static" (that is, "Shared") versus Dynamic Types in VB.NET
Students of Visual Basic .NET may not fully understand the concept of what static (Shared in VB.NET) and dynamic mean in object oriented programming. This article explains it.
Retrieve, Change, or Create Program Information
There are several ways to access program information at runtime in VB.NET. The techniques include Reflection, use of the Environment, and My.Computer but there are several other techniques as well. This article covers all of them.
Using Interfaces In Separate Files
This article answers a reader question about it now to use Interfaces in VB.NET. Although it's easy to find references that show how an Interface works, this article also shows how it works with when the code is in separate files.
Commanding Your Program!
A lot of programs, called Console Applications, are designed to be used at a Command Prompt. This article is a anthology of techniques that involve the use of the Command Prompt in both VB.NET and in VB 6.
VB.NET, SetEnvironmentVariable, and the Windows API
In VB 6, it was common to be required to use Windows API calls to get things done. In VB.NET, it doesn't happen very often, and, quite frankly, it's a lot harder to do. Before .NET 2.0, using SetEnvironmentVariable was one one of the times when a Win API call was necessary. This article shows you how to call this API in Windows.
Environmental Awareness!
The "environment" is a where DOS saved global information, but it hasn't gone away! This short article tells you everything a .NET programmer needs to know about programming the environment.
Interpreting the UML Modeling Language for Programmers
There is a lot of information available about how to do UML (Unified Modeling Language) analysis but most of it is written for systems analysts. Here's an article about UML that is written for programmers.
Regular Expressions in VB NET
Regular expressions - also known as "RegEx" - are strings of text used to match patterns in other strings. Support for RegEx is great in VB.NET and this article is is a "from the ground up" explanation of to use it.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This is Part 10 of a complete introduction for programmers. Image animation, and in particular, GIF animation is explained in this segment of the tutorial.
Refactoring Tools for Visual Basic
Refactoring is a technique of upgrading software by improving the internal structure without changing what it does. This article explains five refactoring software systems for Visual Basic 6 and VB.NET.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This is Part 9 of a complete introduction for programmers. This part explains Metafiles. These are files that describe a sequence of graphics operations that can be recorded (constructed) and played back (displayed).
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This is Part 8 of a complete introduction for programmers. Graphics using images are explained in this segment, including bitmap images, thumbnails, and icons.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This is part 7 of a complete introduction for programmers. The final discussion of the vector graphics is here. The use of color and transparency is also discussed.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 6 of a complete introduction for programmers. This article goes beyond simple shapes and shows how to create shapes from sets of points and combinations of other shapes using the GraphicsPath object. We also show how to use that object as a clipping region to control what parts are drawn.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 5 of a complete introduction for programmers. In this article, the concept of a coordinate space is explained and graphic transformations using the Matrix object is demonstrated.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 4 of a complete introduction for programmers. In this article, blending colors and merging an image with a vector graphic are explored with an example of a shape using color blending and overlaid images that can be varied according to a value in a variable. The result is a temperature guage that varies from blue to red and is overlaid with different transparent GIF images.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article answers a reader's question about how to use GDI+ to draw a colored lights in a traffic signal as a way to explain binary numbers.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 3 of a complete introduction for programmers. In this article, we continue the study of vector graphics and we introduce bit mapped graphics with a different way to display a an image by filling a very thick line with the image using one of the brush objects.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 2 of a complete introduction for programmers. In this article, "vector graphics" - drawing lines and shapes - is discussed. The standard sine, cosine, and tangent trigonometric functions are graphed as an example.
GDI+ Graphics in Visual Basic 2005 .NET
GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic 2005 .NET. This article is part 1 of a complete introduction for programmers.
Using Try Blocks To Clean Up Code
You can use a Try block to make your code more foolproof in addition to using it for error processing. This quick "best practice" article shows an example using a subroutine that Overrides the MouseMove method in .NET and how a Try block can improve the code.
When Form.Load isn't enough
Most Windows applications use Form.Load for initialization code, such as setting the starting value of variables or perhaps downloading starting values from a database. But what if your program needs more control? You might want to put all of your intialization code in a different module for security reasons, for example. This article shows you how to code your own Main routine which can then turn control over to a startup form ... or code something else.
How to return from a VB.NET Dialog
Dialogs in VB.NET use object oriented properties and methods, rather than the previous idea used in COM of returning a value, to tell the calling program what happened in the dialog. Like everything else in .NET, this may require an adjustment in your thinking to use them correctly. This article tells you how VB.NET dialogs work.
The VB.NET LinkLabel
LinkLabel, new in Visual Basic .NET, is a standard control that lets you embed web-style links in a form. Like many VB.NET controls, this one doesn't do anything that you couldn't do before ... but with more code and more trouble. LinkLabel makes it easy. This article tells you everything you might need to know about using it.
Visual Basic Compiler Directives
Visual Basic Directives are the other Visual Basic. It's just a two-statement language, but you can use to "direct" the Visual Basic compiler. The resulting compiled program never contains code from these statements, but different types of programs can be created by using them. This article explains how to do it.
Is Visual Basic in Trouble?
A survey from Evans Data has highlighted an apparent drop in the popularity of Visual Basic. In this article, the Visual Basic Site Guide for About.Com explains what he thinks it all means.
Visual Studio Macros
Starting with Visual Studio 2003, the tradition of macro programming has been restored to Microsoft's development technology. Macros are Visual Basic programs that automate the work that you can do inside Visual Studio - menu selections, keyboard entries and so forth. These programs can then be stored and recalled with a single command or keyboard stroke. But a Visual Studio macro can also be much more. This article explains it all.
How To Use (And Create) Code Snippets - Part II
Using Intellisense Code Snippets - Intellisense Code Snippets are ready-made chunks of code that you can quickly plug into your Visual Basic projects. But they're much more than just code. Visual Basic 2005 includes over 500 code snippets but you can create your own. This article shows you how to do all of this and more!
The Visual Basic 2005 Cookbook Redux
A companion article to the full review of The Visual Basic 2005 Cookbook, this article is a review of Chapter 7, "Dates and Times" by a real expert on dates and times, Peter Zilahy Ingerman, PhD.
How To Use (And Create) Code Snippets - Part I
Using Intellisense Code Snippets - Intellisense Code Snippets are ready-made chunks of code that you can quickly plug into your Visual Basic projects. But they're much more than just code. Visual Basic 2005 includes over 500 code snippets but you can create your own. This article shows you how to do all of this and more!
Application Settings in VB.NET 2005
VB.NET 2005 gives you a sophisticated new way to persist application settings such as connection strings or component properties like size or color by application or by user. The methods used in VB.NET 2005 are different than the ones in VB.NET 1.1 and other .NET languages such as C#. Technical articles on the web and even on Microsoft's own pages frequently make mistakes in describing how it's used. This article clears up the confusion.
Very Simple Encryption using VB.NET
Learn how to code your own very simple encryption with this Visual Basic .NET program. Sophisticated and virtually unbreakable encryption is available in abundance in today's software. But setting up and using "industrial strength" encryption can be a lot of effort. If you just want a way to encrypt a simple text file, here's a downloadable program that does the trick, programmed in VB.NET 2005 Express.
References and Namespaces in VB.NET
The concept of a namespace is new to VB.NET and this makes it one of the things that can confuse someone making the switch from VB 6 to VB.NET. This article explores the concept of a namespace and explores the different ways that it can be used in VB.NET. The article was inspired by a thread in the About Visual Basic Forum.
Using Files as a Database
A database is often just a little too much for a simple program that only needs to manage a few "records" of data. If your program needs a few items, but not enough to justify setting up a complete database, this article shows you how to use multiple files for a "quick and dirty" database. The files are maintained using XML. The new "My" namespace in Framework 2.0 is also used to manage the files. The first article in this two part series describes how to create the XML portion of the program.
Coding an XML Configuration File
Creating a configuration file is a common programming task. This article shows how to create one using standard XML and Visual Basic .NET 2005. The article also includes the complete code for a sample application that persists basic information for a stock market calculation utility program.
Inheriting Controls in VB.NET
Inheriting the all of the code - methods and properties - in an existing control and then customizing that control is a useful technique that is explained in this article. A real example using the new Framework 2.0 control, WebBrowser, is also provided.
MSBuild: A New Build Technology Added In Visual Basic 2005
"Build" is the process of controlling the creation of compiled solutions. MSBuild is a new way to "build" these software solutions in Microsoft .NET Framework 2.0 and Visual Basic 2005. This article describes what's new and introduces MSBuild concepts.
Formatting: From VB 6 to VB.NET
The concept of formatting strings has changed a lot in the move up to .NET. At the same time, compatibility with older VB 6 methods has been kept. This article describes how it used to be and how it's done now.
VB.NET Adds Block Level Scope
In addition to making required variable declaration the default, VB.NET adds a new block level scope for variable declaration This article shows what has changed, but also explores some results of this change that you might not expect.
Early Binding and Late Binding
[p]An explanation of "early binding" and "late binding" with the advantages of early binding explained and examples. This article was written for, and tested with VB.NET 2005 Express Edition but the concepts apply to any version. [p]The "textbook" definition goes something like this (copied from Microsoft's MSDN page): [p]"An object is early bound when it is assigned to a variable declared to be of a specific object type."
The Date Bug in VB 6 to VB.NET Conversion
Visual Basic 6 lets you code dates in sloppy ways that VB.NET can't correct. This article shows you what happens and why.
Data types in VB.NET
Data types in VB.NET
The Decimal data type in VB.NET
The Decimal data type in VB.NET
Printing in Visual Basic .NET
Printing in Visual Basic .NET
Partial Classes in Visual Basic .NET 2005
Partial Classes in Visual Basic .NET 2005
Disappearing Label Text
Unexpected behavior involving the UseMnemonic property of the Label component can cause the Text in a Label to disappear entirely.
CalcPad Using VB.NET Queue Objects
CalcPad Using VB.NET Queue Objects
User Control Components in VB.NET
A short tutorial about how to create a User Control in VB.NET. The article contains the code for a four function calculator that you can implement as a control.
VB.NET: What Happened to Control Arrays!!! (Part VII)
VB.NET: What Happened to Control Arrays!!! (Part VII)
What's New in Visual Studio 2005!
What's New in Visual Studio 2005!
Setup Project Deployment in VB.NET 2005 - Part II
Setup Project Deployment in VB.NET 2005, the File System Editor Designer
Setup Project Deployment in VB.NET 2005 - Part I
Setup Project Deployment in VB.NET 2005 - Part I
Using the Microsoft Windows Install MSIEXEC utility
Using the Microsoft Windows Install MSIEXEC utility
Step-by-Step: A First ClickOnce Application
Step-by-Step: A First ClickOnce Application
Using ClickOnce Deployment in VB.NET 2005
Using ClickOnce Deployment in VB.NET 2005
Deployment options for Visual Studio .NET 2.0 overview
Deployment options for Visual Studio .NET 2.0 overview
Assemblies in .NET: What they are and how to manage them
Assemblies in .NET: What they are and how to manage them
Debugging a Web Service
Debug a Web Service
Globalization in Visual Basic .NET
How to display values using localization and customized culture settings using Visual Basic .NET.
How To Use Resources in Visual Basic .NET
How To Use Resources in Visual Basic .NET
VB.NET: What Happened to Control Arrays!!! (Part VI)
A method for implementing Visual Basic 6 control arrays in VB.NET.
Queues and Stacks - Another great tool in VB.NET
A Calculator program, previously featured at About Visual Basic, is reprogrammed using the VB.NET Queue object rather than conditional logic for more clear code, smaller code, and the elimination of bugs in the previous version. The VB.NET Stack object is also explained.
Tic Tac Toe ... A journey from VB 6 to .NET and GDI+
An explanation of the from the ground up rewrite of the Tic Tac Toe game from Visual Basic 6 into VB.NET with an emphasis on using GDI+
GDI+ Details of the Tic Tac Toe Program Changes
How the VB.NET and GDI+ version of the Tic Tac Toe program works internally. How to program overlaid form controls is also demonstrated.
Adding GDI+ to the Tic Tac Toe Program
An explanation of how to use GDI+, Graphics Device Interface for .NET, to draw graphic elements in calculated locations on a Windows form using mouse location information returned by .NET.
Getting Started with GDI+ (Graphic Device Interface Plus)
A first tutorial about using GDI+, the Graphic Device Interface Plus software technology from Microsoft, with Visual Basic 2005.
New Controls in VB.NET 2005
A review of the new controls available in Visual Basic 2005 Express Edition.
ILASM - The compiler for the language of .NET: CIL
An introduction to the .NET Framework tool ILASM.exe
"Introducing Microsoft Visual Basic 2005 for Developers" and Microsoft "My Learning"
A book review of the Microsoft Press book, "Introducing Microsoft Visual Basic 2005 for Developers" and a review of the new Microsoft "My Learning" system.
Visual Basic 2005 Express Edition - Expressly the Best!
A review of the CPT Beta 2 version of Microsoft Visual Basic 2005 Express.
Visual Web Developer 2005 Express - Back to the Future!
A review of the CPT Beta 2 version of Microsoft Visual Web Developer 2005 Express.
SQL Server 2005 Express Edition - The Time is Now!
SQL Server 2005 Express Edition - The Time is Now!
SN.EXE - Code Strong Programs with Strong Names
An introduction to the .NET Framework tool sn.exe
AL and VBC - 'Breaking Up Is Hard To Do'
An introduction to the .NET Framework tools al.exe and vbc.exe.
GACUTIL - Sharing your work in the Global Assembly Cache - A Framework Tool
An introduction to the .NET Framework tool gacutil.
NGEN - When Your Need Is Speed - A Framework Tool
An introduction to the .NET Framework tool NGEN.
ILDASM and the .NET Framework Tools
An introduction to the .NET Framework tools, including an introduction to ILDASM.
Reflection: Retrieve, Change, or Create Program Information at Runtime
An introduction tutorial for students of VB.NET in learning to use reflection in Visual Basic programming.
VB.NET: What Happened to Control Arrays!!! (Part 5)
A method using a class that is saved in an array to handle collections of controls that is somewhat like VB 6 control arrays.
The Class Modifiers in VB.NET
A reference to the class modifiers that you can code in your VB.NET program
VB 6 Collection, VBScript Dictionary, and VB .NET Hashtable
The VB 6 Collection object, the Scripting Dictionary object and the VB .NET Hashtable object Explained! In this mini-tutorial, we'll go over the idea of collections, dictionaries, and hashtables and then demonstrate those ideas with code. This is a great "how to" for those of you who want VB.NET explained in terms of what VB 6 can do.
About Calculating Leap Years
A complete explanation of how to calculate leap years in Visual Basic, what problems are out there, and why it's necessary.
Attributes in VB .NET
Attribute is a word that has been overloaded. Overloading is not just an object oriented programming technique. It's also something that happens to ordinary words when you're trying to figure out how to use a sophisticated development environment like VB .NET! Here's an introduction to how attributes are used in VB .NET.
Visual Basic .NET & the .NET Platform: An Advanced Guide (book review)
When you first pick this one up from the shelf in the bookstore, you know you're into something serious. At almost two inches, over a thousand pages, and over two thousand files in the source code download -- this one is for real.
VB.NET: What Happened to Control Arrays!!!
Although a lot of VB.NET experts say that leaving VB 6 'control arrays' out of VB.NET is a positive step, it drives many VB 6 programmers bats. Here's a two part article that tells you everything you need to know about how to replace this function in VB.NET.
AndAlso and OrElse - VB .NET New Logical Operators
VB.NET features two new logical operators that help make your programming ... well ... more logical. The new operators are AndAlso and OrElse. This article explains how they're different ... and better ... than the old VB 6 operators.
VB.NET Adds Block Level Scope
One of the changes in VB.NET in variable declaration is a new "block level" scope. Although your first impression might be that this is a great new way to tighten up your code by getting rid of variable declarations for entire procedures when all you need is a counter or flag in a block, once you dig into it there are some problems.
VB.NET in a Nutshell (book review)
These two books are becoming the "must have" references of VB.NET With these books, O'Reilly is taking the "high road" of adding more value and including more content for your book buying dollar.
VB .NET Hashtable, Capacity and Loadfactor
When you actually measure the performance of the Hashtable object with different parameters, you get some strange numbers. Parameters can be passed when a Hashtable object is created that are supposed to affect performance. But the results were not what was expected.
The VB.NET Upgrade Wizard
The Web is full of articles about the differences between VB 6 and VB.NET. Most of these are long lists of differences ... additions, changes, deletions. Just browsing these lists is a real cure for insomnia. But few of them take you completely through an actual conversion. That's what we do in this article.
Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Using VB.NET

©2009 About.com, a part of The New York Times Company.

All rights reserved.