Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / January 2006

Tip: Looking for answers? Try searching our database.

System.Windows.Forms.Design.Behavior.DropSourceBehavior

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thomas hulka - 06 Jan 2006 00:55 GMT
The type of Drag-and-Drop data in a Windows Forms Designer (eg derived from
ControlDesigner)
is of type

System.Windows.Forms.Design.Behavior.DropSourceBehavior

To my surprise this class is defined internal in System.Design. How can one
find out the control is dragged?
I believe this class should not be internal.

~thomas
jokiz - 06 Jan 2006 02:14 GMT
i'm not familiar with 2.0 but perhaps you can hook up with
componentadding event of IComponentChangeService just like 1.1
thomas hulka - 06 Jan 2006 02:58 GMT
Thank you for the hint, since I am using the whole draganddrop
infrastructure, this would
lead to a difficile design. At this time, I am using a workaround via
reflection:

Type t = de.Data.GetType();
  if (t.Name == "BehaviorDataObject")
  {
   PropertyInfo pi = t.GetProperty("DragComponents");
   ArrayList comps = pi.GetValue(de.Data, null) as ArrayList;
   if (comps != null && comps.Count > 0)
   {
    object o = comps[0];                                                //
here I get my dragged OutputControl
    if (o.GetType() == typeof(OutputControl))         {     // lets see if
is really an OutputControl

This returns the DragComponents property from DropSourceBehavior which in
turn holds
the dragged control in its ArrayList.

However, I would like Microsoft to notice that there is a problem with
keeping DropSourceBehavior internal.
Or maybe I missed something. Also to MS: VS 2005 is superdupergreat! i love
it!

thanks jokiz

> i'm not familiar with 2.0 but perhaps you can hook up with
> componentadding event of IComponentChangeService just like 1.1

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.