<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Toolbox Drag &amp; Drop Outside C&#111;ntrol in C#</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Suite Pro : Toolbox Drag &amp; Drop Outside C&#111;ntrol in C#]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 27 May 2026 16:21:21 +0000</pubDate>
  <lastBuildDate>Tue, 01 Mar 2005 13:24:25 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=1795</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Toolbox Drag &amp; Drop Outside C&#111;ntrol in C# : In the next release you can specify...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1795&amp;PID=5475&amp;title=toolbox-drag-drop-outside-control-in-c#5475</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1795<br /><strong>Posted:</strong> 01 March 2005 at 1:24pm<br /><br />In the next release you can specify the drag and drop options for eachindividual group and group item.&nbsp; For example, you can specify that theitem can only be "copied" and not removed.&nbsp; Take a look at theXTPTaskPanelItemAllowDrag enumeration in the next release<img src="http://forum.codejock.com/smileys/smiley17.gif" border="0">]]>
   </description>
   <pubDate>Tue, 01 Mar 2005 13:24:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1795&amp;PID=5475&amp;title=toolbox-drag-drop-outside-control-in-c#5475</guid>
  </item> 
  <item>
   <title><![CDATA[Toolbox Drag &amp; Drop Outside C&#111;ntrol in C# : I have a problem allowing Drag/Drop...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1795&amp;PID=5152&amp;title=toolbox-drag-drop-outside-control-in-c#5152</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=260">Boyd</a><br /><strong>Subject:</strong> 1795<br /><strong>Posted:</strong> 16 February 2005 at 3:22pm<br /><br /><P>I have a problem allowing Drag/Drop of Toolbox items outside of the toolbox.&nbsp; I'm working in Visual C# 2003.&nbsp; I want to be able to rearrange the items within the toolbox (through drag/drop), but I also want to be able to drag/drop an item on a control outside the toolbox.</P><P>I have set all the 'AllowDrag' and 'AllowDrop' properties so that everything works within the control itself.&nbsp; When I drop an item on a control outside the toolbox, I get some XML text indicating what was dropped.&nbsp; This is obviously&nbsp;the default text&nbsp;for the object that's dropped.&nbsp; Each item in my toolbox represents a snippet of text (like previous text values copied to the clipboard), so the text I want to have dropped on the other control is the underlying text that I have stored in the 'Tag' property of the item.</P><P>In the .NET world, you work with DragDrop event through classes that inherit from the IDataObject interface.&nbsp; You initialize a DragDrop routine by calling the 'DoDragDrop' method and pass&nbsp;it an IDataObject.&nbsp; I placed the following code in the 'BeginDrag' event of the toolbox:</P><P>if (e.item.Tag is string)<BR>&nbsp;&nbsp;&nbsp; DoDragDrop(e.item.Tag.ToString(), DragDropEffects.Copy);</P><P>This works great for dropping the text stored in the Tag property on a control outside the application.&nbsp; The problem now is that Drag/Drop functionality within the control itself will no longer work.</P><P>At this point, I have to decide between internal drag/drop functionality or external drag/drop functionality, but not both.&nbsp; The default text used for drag/drop just won't work.</P><P>Is there any chance of enhancing the events for drag/drop?&nbsp; If you at least exposed a 'DragLeave' event for when the user drags off the control, I could wait to call the 'DoDragDrop' method until the user actually drags off the control.</P><P>The following events are available within .NET and provide all the flexibility you would need for handling drag/drop:</P><OL><LI>QueryContinueDrag - validates if drag/drop should continue <LI>DragDrop - item is dropped on the control <LI>DragEnter - drag operation enters the control for the first time <LI>DragLeave - drag operation leaves the control <LI>DragOver - drag occurs over the control</LI></OL><P>Of these useful events, we only have equivalents for 'DragDrop' (through ItemDrop event) and 'DragEnter' (through BeginDrag event).&nbsp; Those of use using ActiveX versions of your controls have to rely on events being exposed for the controls.</P><OL><LI>Do you have any suggestions for working with Drag/Drop in .NET or is there a chance some of these events will be added in a future release?&nbsp; <LI>Also, since I don't want people to be able to drop an item outside the control (since it results in that XML data), can I allow drag/drop within an control but prevent drag/drop outside the control? <LI>Finally, how do I make an item drag in 'Copy' mode so that the original item is not removed from the Toolbox after the drag/drop operation outside the control?</LI></OL><span style="font-size:10px"><br /><br />Edited by Boyd</span>]]>
   </description>
   <pubDate>Wed, 16 Feb 2005 15:22:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1795&amp;PID=5152&amp;title=toolbox-drag-drop-outside-control-in-c#5152</guid>
  </item> 
 </channel>
</rss>