Home » Archive by category "VB.NET"

VB.NET Nullable Types


SQL has long had the ability to specify that a value is NULL even if it is a primitive type, but the only way you could have a NULL value in VB.NET is if you were dealing with an object.

That is, until .NET 2.0

Even though .NET 2.0 has been out for a while, I would bet that few VB.NET programmers know about this new feature because it is one of those things most of us have grown to assume is not possible.

Values must have content–objects don’t.  That’s just the way it is.

Continue reading “VB.NET Nullable Types”

VB.NET Hide Module Name

misc_vol3_064 Here’s a quick tip for those of you still using modules in your VB.NET applications.

If you create a module and don’t want to see the module name in your intellisense, you can hide it with an attribute.  This can be extremely useful when you have a lot of modules that would show up in your intellisense code and they don’t have names that conflict with each other.

Continue reading “VB.NET Hide Module Name”

Decimal vs Float (Single) or Double

money-016 When you need to deal with a number that is a fraction, what do you specify for its type?  If you are like most programmers I know, you’ll reach for Float (Single if you are using VB) or Double.

If you are working with currency, though, this could get you into a lot of trouble.

Here’s why.

Continue reading “Decimal vs Float (Single) or Double”

VB.NET Processing Before WinForm Display


I woke up this morning to an interesting question.

“Using VB.net 2008, I want my project to be a Windows Forms Application, but upon startup, I want to check a few files to see if they exist and if they don’t I do not want the startup form to load. I just want the program to quit. If you have to start this type of application with a form, how do you keep the form from displaying?”

Continue reading “VB.NET Processing Before WinForm Display”

Manually Adding Event Handlers in VB.NET


Typically when we write our code, the event handlers get wired up for us using the handles clause.  So we never have to worry about wiring up our event handlers manually.

But what about the case where we want to dynamically add a control to our Windows Form or our ASP.NET page?  For example, add a button.  How would you respond to the button click event?

Continue reading “Manually Adding Event Handlers in VB.NET”