473,545 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UserControl - Passing drop event to child control

Is there a simple way to pass drag-and-drop events to a child control in a
UserControl?

Here's an example: I have created a UserControl which contains a treeview
and some text boxes. I want to be able to drag-and-drop to the treeview from
outside the UserControl. Now, when I drag over the treeview in the
UserControl, the UserControl gets the drag-and-drop events, but the treeview
doesn't.

Is there a simple way to pass drag-and-drop events to the treview, or do I
need to write the code to do that myself? Thanks.

Dave Veeneman
Foresight Systems
Nov 16 '05 #1
2 7109
Hi Dave,

I've not much experiences with drag-and-drop but i've
one tip:
- set userControl's "AllowDrop" ("AllowDrag" ) to false.

Regards

Marcin
Is there a simple way to pass drag-and-drop events to a child control in a
UserControl?

Here's an example: I have created a UserControl which contains a treeview
and some text boxes. I want to be able to drag-and-drop to the treeview from
outside the UserControl. Now, when I drag over the treeview in the
UserControl, the UserControl gets the drag-and-drop events, but the treeview
doesn't.

Is there a simple way to pass drag-and-drop events to the treview, or do I
need to write the code to do that myself? Thanks.

Dave Veeneman
Foresight Systems

Nov 16 '05 #2
Thanks! Your suggestion solved the problem.

Here are the steps to pass drag-and-drop events to child controls in a
UserControl:

(1) In the UserControl project, set the AllowDrop property of the
UserControl to false.

(2) In the UserControl project, set the AllowDrop property of the child
control to true.

(3) In the client project, the UserControl's property can be set to true or
false; the child control will accept drops with either setting.

"Marcin Grzebski" <mg*******@taxu ssi.no.com.spam .pl> wrote in message
news:ch******** **@atlantis.new s.tpi.pl...
Hi Dave,

I've not much experiences with drag-and-drop but i've
one tip:
- set userControl's "AllowDrop" ("AllowDrag" ) to false.

Regards

Marcin
Is there a simple way to pass drag-and-drop events to a child control in
a UserControl?

Here's an example: I have created a UserControl which contains a treeview
and some text boxes. I want to be able to drag-and-drop to the treeview
from outside the UserControl. Now, when I drag over the treeview in the
UserControl, the UserControl gets the drag-and-drop events, but the
treeview doesn't.

Is there a simple way to pass drag-and-drop events to the treview, or do
I need to write the code to do that myself? Thanks.

Dave Veeneman
Foresight Systems

Nov 16 '05 #3

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

Similar topics

7
5833
by: Kate | last post by:
Hi: I have a form with a picture box and some command buttons to make certain shapes appear in the picture box. The shapes are drawn on blank UserControls added like this: 'at top of form module Dim WithEvents tc As testControl 'button1_click (for example)
2
2705
by: Curtis Justus | last post by:
Hi, I currently have a control that is on a form and I want to pass that exact instance of the control to another form (a child form that appears on a button click). The control has state, etc. that works with both forms. In my button click on FormA, I take my control and pass it to a constructor in FormB. Here is the code in the...
4
10102
by: Andy | last post by:
Alright, I am beyond confused here and need some guidance. I need a C# only sample. I have a simple Page and within it i am creating a user control (ascx). The user control contains textboxes, buttons, ect. I would like to catch/add a handler/recieve the Button.OnClick event from the buttons that are in the user control, in the Page. How?...
4
3097
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three UserControls into the PlaceHolder's child control collection depending upon which of the three radio buttons is selected. Each of the three UserControls have...
9
3335
by: Richard Brown | last post by:
Can anyone give me a good argument one way or another? I have an 'address' set of fields that are used in various situations (a client has an address, a destination has an address, etc). These fields are all normalized into a seperate database table from the client and destination tables. My question is, which is better to create, a User...
0
2425
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that...
9
14425
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it does not. The problem is that the webcontrols get created on the OnLoad event of the usercontrol and the event handlers are assigned at the same...
10
2404
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's my question. Once the UserControl is dropped onto the container page, how can I perform some action on the codebehind of the container page from...
3
1466
by: COHENMARVIN | last post by:
I have an aspx page that loads a usercontrol. Can that usercontrol load another usercontrol into part of it? Thanks, Marv
0
7656
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. ...
0
7808
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...
1
7423
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
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
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
3450
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...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
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
1014
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.