Jun 10
This is one of those “D’oh!” moments. You’re creating your own UITypeEditor. You know the UITypeEditor class is located in the System.Drawing.Design namespace. So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right? Wrong! When you compile your project, the following error may appear:
The type or namespace name 'UITypeEditor' could not be found (are you missing a using directive or an assembly reference?)
It turns out that UITypeEditor is actually defined in System.Drawing.dll, even though it’s located in the System.Drawing.Design namespace. See the disconnect? But you can easily solve this problem by adding to your Visual Studio project a reference to System.Drawing.dll.
Popularity: 1% [?]
Jun 08
When you create a Form with a border, Windows automatically draws a drop shadow around the form, as shown here:

However, if you set the form’s FormBorderStyle property to None, Windows draws neither the form border nor the drop shadow, as shown here:

Read the rest of this entry »
Popularity: 2% [?]
Feb 06
So you’ve set the ToolTipText property of a TabPage in a TabControl. When the user moves the mouse pointer over the tab, the text you specified is supposed to show in a tooltip.

But what if the tooltip is not showing? Fortunately, this problem has an easy solution:
Set the ShowToolTips property in the TabControl to true.
Popularity: 16% [?]
Jan 29
When showing a form that contains a TextBox, it’s common courtesy to focus the TextBox so that the user can begin typing immediately.
To focus a TextBox when a Windows Form first loads, simply set the TabIndex for the TextBox to zero (or the lowest TabIndex for any Control on the Form).
When a Form is displayed, it automatically focuses the Control with the lowest TabIndex. Note that if your TextBox is pre-initialized with some text, then the entire Text will be selected, as shown below:

Read the rest of this entry »
Popularity: 19% [?]
Jul 15
Sometimes it can be challenging to read the Details view in a ListView, especially if the rows are long. This article shows how to add shading to every second row to make a ListView easier to read.

Read the rest of this entry »
Popularity: 29% [?]
May 07
This is one of those things that's obvious once you know it. When dealing with COM, there is often a need to convert a WinForms Form object to an IntPtr handle, and vice versa.
Read the rest of this entry »
Popularity: 23% [?]