QuickTips Index
Getting Input and Validating It
A reader asked for help coding a loop to input data to a ListBox control. The problem was that the reader was using the holdover InputBox from VB6. There are better ways and this Quick Tip shows one of them: the Validating Event of a TextBox control.
Fixing the InputBox
A reader asked for help using InputBox to code a loop to input data to a ListBox control. The InputBox is a VB6 holdover function that probably shouldn't be used. Another article that is linked in this one shows why and what to do instead. But this article shows how to use unmanaged code to solve one problem with the InputBox: You can't tell the difference between blank input and the Cancel button.
Predicate Explained
"Predicate" expressions, an integral part of VB.NET 2008 Lamda expressions, are explained in this Quick Tip.
Use a VBA Macro To Change the Background of a Cell
A reader asked how to change the background color of an Excel spreadsheet cell with VBA macro code. The answer involved some techniques that could come in handy for more than just this. This Quick Tip explains it all.
Display a PDF With VB.NET
PDF is an Adobe format for presenting documents. But since Adobe is a competitor to Microsoft, there's uneven support for the format in Microsoft products. You can save Office files as PDF files, but Microsoft doesn't provide any software tools for integrating the format into systems created with VB.NET. But you can do it anyway. This Quick Tip shows you how.
Object Initializers - A New Feature of VB.NET 2008
VB.NET has a quicker way to initialize data objects. This Quick Tip shows you how to do it with both parameter based constructors and anonymous types.
Anonymous Types - What and How
Anonymous types are a quicker way to use objects, but some of the tricks in using them are not obvious. This Quick Tip explains it all.
Events - Program and Handle Your Own Unique Event in VB.NET
Handling events that are made available to you by other objects is easy. Mainly, you just have to select the event in the code window and add some statements to the event subroutine that is automatically created. But what if you want to create your own event? This Quick Tip shows you how.
Write Programs That Run When a File is Added, Changed, or Deleted
The FilesystemWatcher component makes it easy to write programs that run when a file has been added, deleted, or just changed.
Accessing a Secure Web Site Using VBA
A reader asked if VBA could be used to login to a secure web site using HTTPS and SSL. The answer is yes ... and no. This Quick Tip explains what that means.
Use The Registry To Find The Path To A Program In VB.NET
A reader asked for help finding a way to determine the path to installed software. This Quick Tip not only shows how to do that, it can serve as an introduction to working with the Windows registry in general using VB.NET.
Programming Control Arrays in VB.NET
The lack of VB6 Control Array in VB.NET is by far the most popular single topic at About Visual Basic. A lot of programmers remember the convenience of simply dragging and dropping multiple controls onto a form and then addressing them as an array of controls. The topic attracted ideas from programmers for years after the original article that I wrote about it. This article is a summarization of all of the ideas received about the best way to program something similar in VB.NET.
The Equals and ReferenceEquals Methods of the Object Object
The root of the .NET Framework contains six public methods and two of them are used for testing equality: Equals and ReferenceEquals. This article explains how those two work.
The ToString Method
The ToString method is one of the fundamental methods in the root of the entire .NET Framework. That makes it available in every other object. This quick tip shows some of the ways ToString can be used.
The Object Object
The Object object is the root of the entire .NET Framework. That means that the methods and properties of Object are available all the time and in every .NET Framework object because everything inherits from Object. This Quick Tip tells you about it.
Block Level Scope in VB.NET
VB.NET uses what is called block level scope for variable declarations. This article shows what it is, and also explores some dark corners that you might run into when you use it.
Open a Web Document at a Specific Location
A reader asked for help finding a way to open a specific location in an HTML document using the # marker in a URI. (As in file:///C:\webdoc.htm#location). The reader was trying to use Process.Start(). This doesn't work. But WebBrowser.Navigate() does.
The Region Directive in VB.NET
In the very first edition of VB.NET, compiler generated code was kept in a hidden Region section to protect it from being accidentally changed. When Framework 2.0 was released, Microsoft started using partial classes to do the same thing. But the Region directive is still available to programmers to use to make their own code better organized and easier to read. This Quick Tip shows you how to use it, and why.
ErrorProvider - A Visual Control For Windows Forms
The Windows Forms libraries in Visual Basic .NET includes a number of convenient provider components. One of these is the ErrorProvider component that pops up an icon to tell the user that something is wrong when your program is validating user input. This Quick Tip tells you how to use it.
Arrays: The Difference Between Jagged Arrays and Rectangular Arrays
There are two ways that you can declare an array in Visual Basic. You can declare it as a multidimensional rectangular array or a jagged array. There are some very important differences and this Quick Tip explains what they are.
How a VB.NET Structure Is Different From a Multidimensional Array
A structure and a multidimensional array have a lot in common in Visual Basic .NET programming. Often, you can use either one and your program will work just as well either way. But there are some clear differences. This Quick Tip helps you understand both of them so you can manage information inside a program better.
Friend and Protected Friend in VB.NET
Visual Basic .NET is completely OOP (Object Oriented Programming) because it supports inheritance, the major thing that previous versions of Visual Basic did not support. And because it supports inheritance, it also has two new access modifiers: Friend and Protected Friend. This Quick Tip introduces them to you.
Using Shared Access in Visual Basic .NET
When you instantiate, that is, "make a copy," of an object in VB.NET, it usually means that the members in the instance are unique from any other copies. But some members can also be Shared. This Quick Tip shows you what that means.
The SOOPercharged VB.NET sender and e Parameters
The sender and e parameters passed by the system to standard VB.NET event subroutines are key elements in your programming toolkit. It's all part of the new sOOPercharged VB.NET. This Quick Tip explains how to use them.
VB.NET and Recursion
Recursion is a valuable programming technique and when a programming problem requires this technique, nothing else quite works. But there is a hidden trap in recursion that you need to know about: It can eat memory resources like nothing else. This Quick Tip explains it.
