<?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>Furo&#039;s World &#187; contextMenu</title>
	<atom:link href="http://www.furo.fr/tag/contextmenu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.furo.fr</link>
	<description>Welcome to my piece of web!</description>
	<lastBuildDate>Fri, 15 Jul 2011 08:59:33 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ContextMenu and TreeView in C#</title>
		<link>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/</link>
		<comments>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 17:51:31 +0000</pubDate>
		<dc:creator>Flotueur</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[contextMenu]]></category>
		<category><![CDATA[TreeView]]></category>

		<guid isPermaLink="false">http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/</guid>
		<description><![CDATA[Since a lot of time, I had a problem with the ContextMenuStrip on my application: when a user did a right-click on a node in one of my tree without having selected with left-click first, the node meant to be selected was not! To fix that, just add this code on your tree &#8220;treeView1&#8243; when [...]]]></description>
			<content:encoded><![CDATA[<p align="left"><img src="http://www.furo.fr/wp-content/200px-visual_basic_net_logo1.thumbnail.jpg" alt="Logo .NET" align="left" hspace="10" vspace="10" />Since a lot of time, I had a problem with the <strong>ContextMenuStrip </strong>on my application: when a user did a <strong>right-click</strong> on a node in one of my tree <strong>without having selected with left-click first</strong>, the node meant to be selected <strong>was not</strong>!</p>
<p>To fix that, just <strong>add this code</strong> on your tree &#8220;treeView1&#8243; when the <strong>event </strong>&#8220;MouseDown&#8221; occurs:</p>
<blockquote><p><code>private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
TreeNode tn = treeView1.GetNodeAt(e.X, e.Y);<br />
treeView1.SelectedNode = tn;<br />
}</code></p></blockquote>
<p>Troubles are finished for my customers! (and by extension for me as well <img src='http://www.furo.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

