<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C# 411 &#187; Windows Forms</title>
	<atom:link href="http://www.csharp411.com/category/windows-forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Mon, 19 Jul 2010 14:56:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add Drop Shadow to Borderless Form</title>
		<link>http://www.csharp411.com/add-drop-shadow-to-borderless-form/</link>
		<comments>http://www.csharp411.com/add-drop-shadow-to-borderless-form/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:32:23 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/add-drop-shadow-to-borderless-form/</guid>
		<description><![CDATA[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:

 

So what if you don’t want a form border, but you do want [...]


Related posts:<ol><li><a href='http://www.csharp411.com/hide-form-from-alttab/' rel='bookmark' title='Permanent Link: Hide Form from Alt+Tab'>Hide Form from Alt+Tab</a></li><li><a href='http://www.csharp411.com/c-focus-textbox-on-form-load/' rel='bookmark' title='Permanent Link: C# Focus TextBox on Form Load'>C# Focus TextBox on Form Load</a></li><li><a href='http://www.csharp411.com/c-winforms-form-event-order/' rel='bookmark' title='Permanent Link: C# WinForms Form Event Order'>C# WinForms Form Event Order</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/add-drop-shadow-to-borderless-form/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Set InitialDirectory for FolderBrowserDialog</title>
		<link>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</link>
		<comments>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:34:40 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</guid>
		<description><![CDATA[The .NET FolderBrowserDialog class does not have an InitialDirectory property like the OpenFileDialog class.&#160; But fortunately, it’s quite easy to set an initial folder in the FolderBrowserDialog:
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.RootFolder = Environment.SpecialFolder.Desktop;
dialog.SelectedPath = @&#34;C:\Program Files&#34;;
if (dialog.ShowDialog() == DialogResult.OK)
{
    Console.WriteLine( dialog.SelectedPath );
}

Note that you can choose other RootFolder’s like MyComputer and MyDocuments.&#160; [...]


Related posts:<ol><li><a href='http://www.csharp411.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/' rel='bookmark' title='Permanent Link: Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog'>Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog</a></li><li><a href='http://www.csharp411.com/console-output-from-winforms-application/' rel='bookmark' title='Permanent Link: Console Output from a WinForms Application'>Console Output from a WinForms Application</a></li><li><a href='http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/' rel='bookmark' title='Permanent Link: The Proper Way to Show the Wait Cursor'>The Proper Way to Show the Wait Cursor</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C# WinForms Form Event Order</title>
		<link>http://www.csharp411.com/c-winforms-form-event-order/</link>
		<comments>http://www.csharp411.com/c-winforms-form-event-order/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 23:00:12 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-winforms-form-event-order/</guid>
		<description><![CDATA[Sometimes it’s important to understand the order of events that occur when a WinForms Form is opened, closed, shown or hidden.&#160; There are also a few “gotchas” that are important to know.
 

Form Open
Following is the order of events when a Form is opened.&#160; Note that the Form’s Visible and IsDisposed property values are listed [...]


Related posts:<ol><li><a href='http://www.csharp411.com/see-all-key-events-with-keypreview/' rel='bookmark' title='Permanent Link: See All Key Events with KeyPreview'>See All Key Events with KeyPreview</a></li><li><a href='http://www.csharp411.com/hide-form-from-alttab/' rel='bookmark' title='Permanent Link: Hide Form from Alt+Tab'>Hide Form from Alt+Tab</a></li><li><a href='http://www.csharp411.com/notifyiconshowballoontip-issues/' rel='bookmark' title='Permanent Link: NotifyIcon.ShowBalloonTip Issues'>NotifyIcon.ShowBalloonTip Issues</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-winforms-form-event-order/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Proper Way to Show the Wait Cursor</title>
		<link>http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/</link>
		<comments>http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 17:26:26 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/</guid>
		<description><![CDATA[It’s common UI courtesy to show the Wait cursor when performing a long operation that requires the user to wait.&#160; Here is how the Wait cursor appears in Windows Vista: 
 
But developers often go about this the wrong way by setting the Cursor.Current property as follows:
Cursor.Current = Cursors.WaitCursor;
  

The problem with this approach [...]


Related posts:<ol><li><a href='http://www.csharp411.com/see-all-key-events-with-keypreview/' rel='bookmark' title='Permanent Link: See All Key Events with KeyPreview'>See All Key Events with KeyPreview</a></li><li><a href='http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/' rel='bookmark' title='Permanent Link: Show ToolTip on TabPage in TabControl'>Show ToolTip on TabPage in TabControl</a></li><li><a href='http://www.csharp411.com/manipulating-controls-across-threads/' rel='bookmark' title='Permanent Link: Manipulating Controls Across Threads'>Manipulating Controls Across Threads</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Close All Forms in an Application in a Thread-Safe Manner</title>
		<link>http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/</link>
		<comments>http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 18:59:54 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/</guid>
		<description><![CDATA[Closing all forms in an application seems like it would be a simple task of using a foreach loop in the Application.OpenForms collection, such as:
foreach (Form form in Application.OpenForms)
{
    form.Close();
}
But there are two problems.

First, the code above will throw an exception because the OpenForms collection changes each time you close a form, [...]


Related posts:<ol><li><a href='http://www.csharp411.com/enumerate-collections-without-exceptions/' rel='bookmark' title='Permanent Link: Enumerate Collections without Exceptions'>Enumerate Collections without Exceptions</a></li><li><a href='http://www.csharp411.com/manipulating-controls-across-threads/' rel='bookmark' title='Permanent Link: Manipulating Controls Across Threads'>Manipulating Controls Across Threads</a></li><li><a href='http://www.csharp411.com/console-output-from-winforms-application/' rel='bookmark' title='Permanent Link: Console Output from a WinForms Application'>Console Output from a WinForms Application</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Show ToolTip on TabPage in TabControl</title>
		<link>http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/</link>
		<comments>http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 21:55:01 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/</guid>
		<description><![CDATA[So you’ve set the ToolTipText property of a TabPage in a TabControl.&#160; When the user moves the mouse pointer over the tab, the text you specified is supposed to show in a tooltip.&#160; 

But what if the tooltip is not showing?&#160; Fortunately, this problem has an easy solution:
Set the ShowToolTips property in the TabControl to [...]


Related posts:<ol><li><a href='http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/' rel='bookmark' title='Permanent Link: The Proper Way to Show the Wait Cursor'>The Proper Way to Show the Wait Cursor</a></li><li><a href='http://www.csharp411.com/show-continuous-progress-with-net-progressbar-and-marqueeanimationspeed/' rel='bookmark' title='Permanent Link: Show Continuous Progress with .NET ProgressBar and MarqueeAnimationSpeed'>Show Continuous Progress with .NET ProgressBar and MarqueeAnimationSpeed</a></li><li><a href='http://www.csharp411.com/add-drop-shadow-to-borderless-form/' rel='bookmark' title='Permanent Link: Add Drop Shadow to Borderless Form'>Add Drop Shadow to Borderless Form</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DataGridView HideSelection to Hide Selection when Grid Loses Focus</title>
		<link>http://www.csharp411.com/datagridview-hideselection-to-hide-selection-when-grid-loses-focus/</link>
		<comments>http://www.csharp411.com/datagridview-hideselection-to-hide-selection-when-grid-loses-focus/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 13:56:13 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Controls]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[DataGridView]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[HideSelection]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/datagridview-hideselection-to-hide-selection-when-grid-loses-focus/</guid>
		<description><![CDATA[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 [...]


Related posts:<ol><li><a href='http://www.csharp411.com/enter-key-in-datagridview/' rel='bookmark' title='Permanent Link: Enter Key in DataGridView'>Enter Key in DataGridView</a></li><li><a href='http://www.csharp411.com/c-focus-textbox-on-form-load/' rel='bookmark' title='Permanent Link: C# Focus TextBox on Form Load'>C# Focus TextBox on Form Load</a></li><li><a href='http://www.csharp411.com/hide-form-from-alttab/' rel='bookmark' title='Permanent Link: Hide Form from Alt+Tab'>Hide Form from Alt+Tab</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/datagridview-hideselection-to-hide-selection-when-grid-loses-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Shaded Rows to ListView Details View</title>
		<link>http://www.csharp411.com/add-shaded-rows-to-listview-details-view/</link>
		<comments>http://www.csharp411.com/add-shaded-rows-to-listview-details-view/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 15:46:32 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[ListView]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/add-shaded-rows-to-listview-details-view/</guid>
		<description><![CDATA[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.


As you may know, you can alter the appearance of individual ListViewItem's such as the Font and BackColor.  But [...]


Related posts:<ol><li><a href='http://www.csharp411.com/see-all-key-events-with-keypreview/' rel='bookmark' title='Permanent Link: See All Key Events with KeyPreview'>See All Key Events with KeyPreview</a></li><li><a href='http://www.csharp411.com/enter-key-in-datagridview/' rel='bookmark' title='Permanent Link: Enter Key in DataGridView'>Enter Key in DataGridView</a></li><li><a href='http://www.csharp411.com/convert-generic-icollectiont/' rel='bookmark' title='Permanent Link: Convert Generic ICollection&#60;T&#62;'>Convert Generic ICollection&#60;T&#62;</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/add-shaded-rows-to-listview-details-view/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Show Continuous Progress with .NET ProgressBar and MarqueeAnimationSpeed</title>
		<link>http://www.csharp411.com/show-continuous-progress-with-net-progressbar-and-marqueeanimationspeed/</link>
		<comments>http://www.csharp411.com/show-continuous-progress-with-net-progressbar-and-marqueeanimationspeed/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 12:55:47 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/show-continuous-progress-with-net-progressbar-and-marqueeanimationspeed/</guid>
		<description><![CDATA[For some operations such as logging on to a web site or downloading a web page, you may not know how long it will take the operation to finish.&#160; So instead of showing a progress bar with a specified percent complete, you can set the .NET ProgressBar to cycle continuously.
 
 
To make a ProgressBar [...]


Related posts:<ol><li><a href='http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/' rel='bookmark' title='Permanent Link: The Proper Way to Show the Wait Cursor'>The Proper Way to Show the Wait Cursor</a></li><li><a href='http://www.csharp411.com/show-tooltip-on-tabpage-in-tabcontrol/' rel='bookmark' title='Permanent Link: Show ToolTip on TabPage in TabControl'>Show ToolTip on TabPage in TabControl</a></li><li><a href='http://www.csharp411.com/disable-the-ctrltab-navigator-window-in-visual-studio-2008/' rel='bookmark' title='Permanent Link: Disable the Ctrl+Tab Navigator Window in Visual Studio 2008'>Disable the Ctrl+Tab Navigator Window in Visual Studio 2008</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/show-continuous-progress-with-net-progressbar-and-marqueeanimationspeed/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Manipulating Controls Across Threads</title>
		<link>http://www.csharp411.com/manipulating-controls-across-threads/</link>
		<comments>http://www.csharp411.com/manipulating-controls-across-threads/#comments</comments>
		<pubDate>Thu, 15 May 2008 16:18:05 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Threading]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/manipulating-controls-across-threads/</guid>
		<description><![CDATA[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 [...]


Related posts:<ol><li><a href='http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/' rel='bookmark' title='Permanent Link: Close All Forms in an Application in a Thread-Safe Manner'>Close All Forms in an Application in a Thread-Safe Manner</a></li><li><a href='http://www.csharp411.com/simplify-delegates-with-inferences/' rel='bookmark' title='Permanent Link: Simplify Delegates with Inferences'>Simplify Delegates with Inferences</a></li><li><a href='http://www.csharp411.com/property-delegates-with-anonymous-methods/' rel='bookmark' title='Permanent Link: Property Delegates with Anonymous Methods'>Property Delegates with Anonymous Methods</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/manipulating-controls-across-threads/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
