473,544 Members | 1,733 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 1192

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

Similar topics

5
4943
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...
6
3534
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...
2
6843
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...
3
8162
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...
4
2054
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
10143
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
10107
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...
2
2079
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...
4
2967
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...
0
7416
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7360
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7363
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...
0
7701
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...
1
5289
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...
0
3403
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...
1
1833
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
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.