DataGridView HideSelection to Hide Selection when Grid Loses Focus

No Comments »

The DataGridView is a powerful grid control included in the .NET Framework.  One function missing, however, is the ability to hide the current selection when the DataGridView control is not focused.  What the DataGridView class needs is a HideSelection property, similar to the ListView and TextBox.  But the .NET designers have not included this capability in the DataGridView class.

Read the rest of this entry »

Display an RTF File that’s a C# Embedded Resource

No Comments »

It’s easy to display an RTF file — that was embedded as a resource in a C# program — in a Windows Form RichTextControl.

Read the rest of this entry »

Manipulating Controls Across Threads

No Comments »

Methods that affect a Windows Forms control can be executed only on the thread that created the control. .NET does not permit directly manipulating controls across threads. The Visual Studio compiler under .NET 2.0 will mark these attempts as errors. .NET 1.1 will allow them, but these will often result in unexpected behavior like incorrectly-painted controls.

Read the rest of this entry »