473,803 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drag and drop broken in Designer Host?

I've inherited a body of C# code that has a 'Designer Host' (DH) based UI.
Custom controls are selected from a 'toolbox' window and placed/sized
in the DH interface. I'm trying to add a feature that allows the user to
drag data, specifically a string, from another window to one of these
controls,
without success. Part of the control definition is:

[Designer(typeof (TactControlDes igner))]
public class TactControl : UserControl
{
...
protected void tactDragOver(ob ject sender,
System.Windows. Forms.DragEvent Args e) {
Console.WriteLi ne("drag over tact");
e.Effect = DragDropEffects .Link;
}

protected void tactDragDrop(ob ject sender,
System.Windows. Forms.DragEvent Args e) {
string dropArg = (string) e.Data.GetData( typeof (System.String) );
if (dropArg != null) {
MessageBox.Show (dropArg);
}
}

public TactControl()
{
// This call is required by the Windows.Forms Form Designer.
InitializeCompo nent();

// TODO: Add any initialization after the InitializeCompo nent call
this.AllowDrop = true;
this.DragOver += new System.Windows. Forms.DragEvent Handler(tactDra gOver);
this.DragDrop += new System.Windows. Forms.DragEvent Handler(tactDra gDrop);

}
. . . neither of the drag event handlers ever get called.

I had thought that this DH technology (about which I'm extremely ignorant)
might not be creating windows for these controls, but Spy++ shows otherwise.

The definition of the DH class being used starts off:

[ProvideProperty ("Name", typeof(ICompone nt))]
internal class DesignerHost : IDesignerHost, IContainer,
IComponentChang eService, IExtenderProvid er, ITypeDescriptor FilterService,
IExtenderListSe rvice, IExtenderProvid erService
{

I'm guessing that the DH stuff might mess with the drag-drop procedure
in order to implement its own toolbox interactions, but I've no idea how,
and no idea where to look.

Any thoughts or pointers would be appreciated . . .
Jan 4 '06 #1
0 1198

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4973
by: Clyde | last post by:
I am trying to implement the user feedback provided by Windows Explorer when draggng a filename from one place to another. I have the drag and drop action worked out but have had no luck in finding how to capture the piece of the screen into a bitmap to simulate the movement. I know this could be done with the Windows API but can't find any way to do it with .Net functions. Any help is appreciated.
6
3562
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product where the user can run on firefox/mozilla, what would be a good approach. 1. Should I overwrite the javascript code drag-and-drop to make it more browser independent. If I want to go this route, can anybody provide me a
2
6853
by: Philippe Meunier | last post by:
Hi, I would like to code kind of Form designer. I would like it to act like the VB.NET designer and the problem I am actually facing is about the drag & drop of controls on the form. I add them with a button (no problem with this) and also resizes them too (no problem there too). But when comes the time to move them with the mouse, changing containers etc. I am speechless. I tried with drap & drop (Dodragdrop) but I get a problem with...
3
8173
by: James Radke | last post by:
Hello, I was curious, is it possible to create drag and drop interface from listbox to listbox on a webform application (i.e. vb.net)? Basically the application would need to load multiple listboxes with values from a database, allow the user to drag and drop from a listbox to a different listbox and would 'move' the item and update the database accordingly? If so, would anyone have any examples of how to do this?
4
2062
by: kemal asad | last post by:
how can i create a vb application where i can drag and drop ( with a move caracteristic) email from outlook, into my application( email viewer). thanks, any help is welcome, samples a great way of learning. Kemal
5
10166
by: Brian Henry | last post by:
I haven't worked much with drag/drop but I am trying to make a form that accepts files to drug onto it from explorer and droped and have the form know the full path and file name of the files dropped onto it.. does anyone have any examples of this? thanks
8
10129
by: benkial | last post by:
I am writing a small GUI tool in C#, and I want to experiment some fancy trick as follows: when the user click on a "OK" button, the code will initiate a "Drag and Drop" operation in the GUI itself to itself (i.e. drag some fake object and drop to the tool itself). I am new to .Net programming, but from my reading can I achieve this using SendMessage() or PostMessage() to force a "Drag and Drop" operation? Thanks in advance,
2
2096
by: Robert Zahm | last post by:
I have created a C# user control which display certain filesystem information, and allows the user to drag an drop files into and out of the control. I then placed this user form in IE using an <object> tag. Doing this has broken the drag and drop functionality from Windows Explorer into IE (it still works fine going from IE to Windows Explorer). The problem is that whenever I drag a file over IE, IE wants to implement the drop...
4
2990
by: stef | last post by:
hello, I'm trying to move from Delphi to Python (move from MatLab to Python already succeeded, also thanks to this discussion group). From the discussions in this list about "the best" GUI for Python, it now seems to me that wxPython is thé choice for my kind of applications. I've no experience with wxPython yet, I just run a few examples and indeed it looks good (as expected from the
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.