1. Computing
Send to a Friend via Email

"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.
  1. LINQ for VB.NET (13)

Shallow Copy versus Deep Copy
The pair of terms Shallow Copy and Deep Copy are seen quite frequently in articles about programming. This article explains what they mean.

Classes - The Class Diagram Tool in Visual Studio
The Class Diagram tool in Visual Studio Professional can help you code your VB.NET programs in multiple ways. You may not be using this tool now because it's just not required for writing programs. This article introduces thise useful tool.

Create a Random Collectionof Unique Integers
A random collection of unique integers is a requirement for most card games and for many other applications as well. This program shows you how to create the collection using a Lamda expression. It also shows how this method performs with graphical results using the StopWatch object. Another method using arrays and more traditional coding can be...

A Database Centered Tutorial for Beginners
Most Visual Basic articles for beginners that use data will either use hard coded data in the program or a simple file. This article shows complete beginners how to use a real SQL Server database for the first time.

Debugging Databases with Visual Studio and SQL Server
Debugging databases requires an understanding of different tools than debugging VB.NET programs. This article is the fourth in a series for beginning Visual Basic .NET database programmers. In this article, the debugging tools in Visual Studio Server Explorer are explained.

Visual Basic, Visual Studio, ADO.NET, and SQL Server
The first four articles in this series designed to help beginners understand how to use SQL Server databases with Visual Basic .NET explain the steps to write simple programs. But since these steps are part of a much larger technology picture, this article brings the relationship of what we have do so far into focus in that picture.

Data Sources, VB.NET, and SQL Server
The seventh article in the beginning database series for VB.NET programmers moves to a higher level by covering the use of data sources to create a VB.NET database application.

Using Data Sources
The eighth article in the beginning database series for VB.NET programmers shows how to refine your use of data sources to create a VB.NET database application that works the way you want it to work. This example uses a Data Source to create the many-to-many result from the database in a Windows Forms application.

Using the CopyFile Object to Show a Progress Bar
A reader wanted to know how to show a progress file while copying a file using VB.NET 2008. The answer is easy, thanks to the magic of VB.NET. Just use a built in option in CopyFile. This Quick Tip also shows examples of the OpenFileDialog and the FolderBrowserDialog as well.

Overloads Versus Overrides
A reader wanted to know, "Why is there is no 'NotOverloadable' as we have 'NotOverridable'?" The short answer is that they're just different. But this was a great opportunity to explain both of them.

Coding a Menu in WPF
Menus are central to most user interfaces these days, so there has to be a way of coding them in WPF and XAML. But since Menus are also a composite kind of thing, there are always a few unique methods involved in creating them. In this example, we use a WPF "User Control" to create the menu so it's a good example of that as well.

What Development Methodology is the right one to use?
Do you have an opinion about development methologies such as Agile Development, Scrum, DSDM, Extreme Programming, or MVVM? Do you have real-life experience in using one? Do you think it's all a fraud? Let us know.

Development Methodologies
Do you have an opinion about development methologies? Do you have real-life experience in using one? Do you think it's all a fraud? Let us know.

Using Numbers from a Web Page in a VB program
A reader was having trouble using numbers copied from a web page in an Excel VBA program. No matter what he did, VBA returned a "Type mismatch" error. The solution was simple. Just convert the offending character. The cause was much more interesting. This Quick Tip tells you what it was.

Part 8: TripPlanner - A Complete WPF and XAML Application 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.

Have you had problems using Application Settings in VB.NET?
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.

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.

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
Lambda expressions were introduced in VB.NET 2008/Framework 3.5 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...

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
The If operator has two new forms in Visual Basic .NET. 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 - Selecting, Deleting, and Moving Lines
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

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.

The "textbook" definition goes something like this (copied from Microsoft's MSDN page):

"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.

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

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

Book Review: "Introducing Microsoft Visual Basic 2005 for Developers"
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.

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.

Resizing a Font in VB.NET
A reader wanted to dynamically resize a font in VB.NET. There are several ways to go about it. This article considers using the ScaleTransform method of the Graphics object, WPF and shows how to declare a new font object for the control.

The Navigate To Tool in VB.NET 2010
VB.NET 2010, actually - Visual Studio 2010 - has a cool new tool that helps you find your way through large systems called Navigate To. This Quick Tip shows you how to get the most from it.

Program an ASP.NET File Based Output Cache
Caching - storing data for future requests - is one of the top features of ASP.NET. This "pro level" article shows how to create an output cache - a cache of a completely rendered ASP.NET page - using a regular disk based file. This capability uses a new feature in ASP.NET 4.0. You can use the code here as it is, or base your design of more advanced ASP.NET output caching on it. This article assu…

Create a Random Collection of Unique Integers
A random collection of unique integers is a requirement for most card games and for many other applications as well. This program shows you how to create the collection using a Lamda expression. It also shows how this method performs with graphical results using the StopWatch object. Another method using arrays and more traditional coding can be...

Structured Exception Handling
Writing the code to take care of errors and problems is something that every really finished application should do. This article explains how to write the code in Visual Basic .NET.

The Validating Event: A Puzzle and Challenge for VB.NET Programmers
Murach's "core" book, Visual Basic 2010 says that you can't exit from a Validating event once it's started. I think I found a way to code around the problem. Can you find a better way?

Multiple Form Instantiation in VB.NET
Should you instantiate a Form before using it in VB.NET with the syntax: Dim myForm as New Form? Technical articles usually recommend that you do. But the real pro's and con's are examined in this article and the traditional recommendation might not be right anymore.

Attributes in VB.NET
Attributes store information about an assembly, a class, a method and many other entities in the Visual Basic assembly metadata. This article explains how it works. It's also part one of a two part article where part two shows you how to embed a private key in the metadata so you can send the entire thing to someone and have a reply securely...

Logical Expressions
Complex logical expressions are not often required in Visual Basic programs, but when they are, it can be really difficult to get them right. This article is a practial (not theoretical) guide to the most popular and useful techniques such as Boolean Algebra, truth tables and Karnaugh maps.

Attributes in Visual Basic .NET - Embed a Public Key to Encrypt a Message
Attributes in Visual Basic .NET - Embed a Public Key to Encrypt a Message

Data Type Conversions in VB.NET Measuring Performance using DirectCast,...
Casting is the process of converting one data type to another, for example, from an Integer type to a String type. Some operations in VB.NET require specific data types to work. Casting creates the type you need. The first article introduces casting. This article comparies the performance of DirectCast, CType and TryCast.

Adding To Your First Database Centered Application for Beginners
Coding a SQL Server database application doesn't have to be an impossible job for a beginner. This article is the second part of a series intended to open up database programming even if you don't already understand it. In the first article, a single table database is created and used to code the traditional "recipe file" app. In this article,...

Programming Insert For One-to-Many Database Tables
Using VB.NET to program a SQL INSERT is the topic covered in the third in a series showing a beginning database application. Although this series is for beginners, we use Visual Studio .NET and SQL Server rather than the Express versions.

Coding the VB.NET Many-to-Many Database App
Many-to-many database relationships are needed in a lot of applications. But in spite of that, it's not that easy to find explanations showing exactly how to program one. The sixth article in this series written for VB.NET programmers who are new to programming databases, shows and explains the code to do this critical type of database application.

Logging Exceptions in VB.NET
Exception logging using VB.NET is simple, easy, and works really well ... unless you want to do something different than the standard functions allowed by the My.Application.Log object. Then it gets a little tougher. This article discusses both.

Enterprise Library - A FREE Resource From Microsoft
Microsoft Enterprise Library may be a resource that can help you move up to world class code. If you need to understand what it is and how to get started, this article is for you. Included in this article is a review of Microsoft's own Visual Basic based guide to the Enterprise Library.

Programming a Custom VB.NET Control
This article shows more advanced ways to create custom controls in VB.NET, and demonstrates how to override a method in an inherited control. A more basic article showing how to get started using Inheritance to build custom controls is referenced in the article.

Visual Studio 11
A review of ALM, Application Lifecycle Management, part of the Developer Preview edition of Visual Studio 11 released in September 2011.

Programming a TreeView
The TreeView class can be one of the most useful ways to organize information visually of any in VB.NET. You see it constantly on web pages, especially at Microsoft. But it's just different enough so that it's often not the first idea many programmers have. This article covers the Windows forms version of TreeView and is designed to change that.

Interface Definitions and Why You Should Care
Most articles you see about the important .NET Interface statement describe the syntax and architecture to get one to work. Few, however, tell you why you should use one. This article does.

Create Random Arrays of Unique Integers
A random array of unique integers is a requirement for most card games and for many other applications as well. This program shows you two ways to create a random array of unique integers, and also shows how they perform with graphical results using the StopWatch object. Another method using collections and a Lambda expression can be found in a...

The Form as an Application
Visual Studio makes us lazy because it does everything. This article explains what a Form application really is and shows how to run one as an application from a console application, both as a single threaded apartment (STAThread) and a multithreaded apartment model (MTAThread).

The Entity Framework
The Entity Framework is only the latest in growing collection of technologies that are all aimed at making it easier for application code to work with databases. Introduced with Visual Studio 2008/Framework 3.5, this technology is most useful for large, complex industrial applications. Rather than just provide tools for the application, the...

Events Using Your Own Code in VB.NET
VB.NET Programmers usually know about handling multiple events with the same subroutine or how to code a delegate. (VisualBasic.About.com articles cover all of these things too.) These are parts of a more general process of event handling. This article starts at the beginning and shows how all of the parts work together using a completely custom...

Shared Events in VB.NET
Most programmers know about shared methods and properties in VB.NET. Shared events are a fairly rare item in code, however. They're primarily useful when you have a parameterized constructor that must raise an event but inventive minds can probably find other uses too. This article is a companion to an earlier article on the creative use of the...

VB.NET Versus Python
A personal perspective of Python based on my attempt to code a finite state machine in Python. After struggling for days to write the program in Python, I wrote the same program in a few hours in VB.NET. The program requires the use of regression to work, so this example demonstrates the code to "walk" an algorithm using VB.NET. Some code using...

Classes - Base Classes and Derived Classes
Classes are the heart of .NET and VB.NET because they're the way Object Oriented Programming (OOP) is actually implemented. A class is the basis of an object. This is one of a series of detailed articles about classes. This article covers base classes and derived classes and introduces inheritance.

Overrides in VB.NET
Shadows, Overloads and Overrides redefine an inherited element. But there are confusing and potentially critical differences. This is the "Overrides" article that is part of a three part series that explains what the actual difference is.

Overriding ToString
ToString is one of the fundamental objects in .NET because it's in the Object Object. That means it's available to every object. All of them. Since it's fundamental, it's worth learning more thoroughly than other objects. This Quick Tip shows how to override ToString with your own custom processing.

Designing Classes - The Singleton Design Pattern
Technical articles, including those at About Visual Basic, usually discuss the detailed syntax of VB.NET, not the overall philosophy of why you might want to do things in a certain way. Design Patterns, on the other hand, are all about the why and how of programming, not the syntax. This article, one of a series about design patterns in VB.NET,...

Inheritance - A Contrast with the Delegation Design Pattern - Part 2 of 3
Design Patterns can be difficult. So this article, part 2 about the Delegation design pattern in VB.NET - is actually all about inheritance since it explains an example intended to contrast with delegation that is based on inheritance instead. Parts 1 and 3 explain the delegation pattern.

A Real World Example of the Delegation Design Pattern - Part 3 of 3
This is Part 3 of a series about the Delegation design pattern in VB.NET. This part shows a more real world example of the delegation pattern based on the general case code in part 1 that you can contrast with the inheritance based example in part 2. Part 1 is a theoretical "general case" of the Delegation design pattern and part 2 is a counter...

The General Case Delegation Pattern - Part 1 of 3
Technical articles, including those at About Visual Basic, usually discuss the detailed syntax of VB.NET, not the overall philosophy of why you might want to do things in a certain way. Design Patterns, on the other hand, are all about the why and how of programming, not the syntax. This article, one of a series about design patterns in VB.NET,...

Design Patterns - The Factory Pattern
Design Patterns deal with the fundamental techniques of how and why you write code in a certain way. This article is one of a series that explains the popular design patterns using the syntax of Visual Basic - VB.NET. The subject of this article is the Factory design pattern.

Coding the Double Linked List "The Hard Way"
The linked list is one of the foundation concepts of programming and it's supported directly by VB.NET language elements. But you can code one "the hard way" too. This article shows one way to do that for a double linked list. The article also features some interesting code details with inherited classes and objects on the heap. Understanding...

Copying Reference Types
When you copy a reference type in VB.NET, you can get just a pointer to the same object in memory. This can result in an obscure bug if you're not clear about what's happening. This Quick Tip explains it and how to avoid the bug.

The Filter Function
Strings may be the second most useful "type" in VB.NET. (Integers are probably the first.) So there is a lot of useful string processing built into VB.NET. The Filter function is one and this article is a fast explanation showing how to use it.

©2014 About.com. All rights reserved.