473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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(TactControlDesigner))]
public class TactControl : UserControl
{
...
protected void tactDragOver(object sender,
System.Windows.Forms.DragEventArgs e) {
Console.WriteLine("drag over tact");
e.Effect = DragDropEffects.Link;
}

protected void tactDragDrop(object sender,
System.Windows.Forms.DragEventArgs 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.
InitializeComponent();

// TODO: Add any initialization after the InitializeComponent call
this.AllowDrop = true;
this.DragOver += new System.Windows.Forms.DragEventHandler(tactDragOver );
this.DragDrop += new System.Windows.Forms.DragEventHandler(tactDragDrop );

}
. . . 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(IComponent))]
internal class DesignerHost : IDesignerHost, IContainer,
IComponentChangeService, IExtenderProvider, ITypeDescriptorFilterService,
IExtenderListService, IExtenderProviderService
{

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 1174

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

Similar topics

5
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...
6
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...
2
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...
3
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...
4
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...
5
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...
8
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...
2
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...
4
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.