<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for drag</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Wed, 03 Dec 2008 01:11:24 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>TreeView Drag n Drop</title>
	<link>http://www.bytemycode.com/snippets/snippet/326/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/326/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 19:46:33 +0000</pubDate>
	<dc:creator>psykoprogrammer</dc:creator>
	<category>.Net, C, drag, drop, treeview</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/326/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  7:46 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/326/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/psykoprogrammer/" title="Helper">psykoprogrammer</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/.Net">.Net</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/C">C</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/drag">drag</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/drop">drop</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/treeview">treeview</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/326/comments/">2 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 9
			<p>Below is a bit of code which sets up drag and drop in a treeview. This is handy for if you have a list of items that can be sorted by the user. <br /><br />Here is a bit of code to demonstrate how to do this. First create a new Windows executable project. Drop a TreeView component on the form, and let's name it 'myTree' for this demonstration. Go ahead and populate it with some dummy data; enough data to see the dragging and dropping in action. You will need a variable global to the form's scope. <br /><br />private TreeNode sourceNode;<br /><br />This is used to track the item we are dragging in our TreeView. Then define the event handlers listed below.</p>
		]]>
	</description>
</item>
	</channel>
</rss>