December 23, 2002

ConcatenateStrings – Concatenating an array of strings

‘ Concatenate the input strings, and return the resulting string. The first ‘ input string is used as a separator.” Example:’ Dim i As Integer = 4′ Dim d As Double = 34.45′ Dim s As String = “VB-2-The-Max”‘ Dim ret As String = ConcatenateStrings(” “, s, “is a nice

Creating multiline tooltips

In VB6 there was no easy way to create multiline tooltips for form controls, you necessarily had to resort to API tricks. And it was probably just not worth the effort. The good news is that doing this is straightforward in VB.NET! First add a Tooltip Provider control on the

Adding an image as an embedded resource, and loading it from code

To add an image as an embedded resource in a Windows Forms application, add the image file to the project with Project | Add Existing Item. Then select the file in the Solution Explorer, go to the Properties Window, and set its Build Action property to Embedded Resource. At this

Changing the project’s output type

When you start developing an application, the first thing you do in VS.NET is creating a new project and selecting its type: Windows Forms application, Class Library etc. However, it may happen that later in the development you want to change the project’s output type. For example, you could have

Parsing and validating string dates

If you have a string variable that should specify a date (asked in input to the user, for example), you can parse the string and get a Date variable by using the Date.Parse method. If the input string is not in a valid format, this method throws an exception though.

Retrieving the state of the Shift, Alt and Ctrl keys, at any time

You can know the state of the Shift, Alt and Control keys at any time, not just from inside a Keyxxx event. The shared property Control.ModifierKeys returns a bit coded value that identifies which of those keys are pressed, and you can use the And bit operator if a specific