473,434 Members | 1,854 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,434 software developers and data experts.

User Control MouseUp

Udi
Hi,
I have a user control - A that has a panel that contains
a list of a different user control - B.
When I'm adding a new B to A, I'm subscribing a handler
(which is a method of A) to B.MouseUp.
However, when I click B the event is not fired.

See example:
class A : System.Windows.Forms.UserControl
{
void OnButtonAddBctrl(...)
{
:
B ctrl = new B(...); // B is a UserControl
ctrl.MouseUp +=new MouseEventHandler(Bctrl_MouseUp);
this.panel1.Controls.Add(ctrl);
:
}

void Bctrl_MouseUp(...)
{
// Never getting here when clicking B
}
}

What is wrong?
Thanks!

Feb 7 '06 #1
1 3114
Udi
I think I know what my problem is -
the user control B is filled with a panel that contains a list of a
third user control - C.
So it seems like the panel "hides" the B from mouse events.
Do I need to pass (and subscribe) my handler to each and every one the
children of B( i.e the panel and all C's in it)?
Is there a way of doing it automatically?
Thanks.

Feb 7 '06 #2

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

Similar topics

0
by: Mark Schwarz | last post by:
Hello everyone, I've a problem using SetCapture and MouseUp events. I've done an app that is doing SetCapture(Handle) on a buttonclick event and have a mouseup event that shows a MessageBox and...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
1
by: coderjoe | last post by:
I'm new to VB.Net and I'm using the 2003 version. I created a user control that has two labels on it. The two labels are side by side. The first is bold font and will be used to display a line...
2
by: dave.wayne | last post by:
In a web page I have a div tag that has a onlick event registered through the event listener. However, that same div tag also has a onmousedown - start a drag and drop script The problem I am...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
7
by: MasterMax1313 | last post by:
I'm trying to make a grid of picture box controls, which I do via code. Each of these boxes has a mouseclick, mousedown, mouseup, and mouseenter event. The mouseclick event is simple enough and works...
0
by: aseem | last post by:
how to drawline between two user control using mousedown and mouseup events in c#.net I am using radiobutton_MouseDown and radiobutton_MouseUp events the user control are dropped on the panel...
4
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I developed a Composite Control with Visual C# (Rocker Button). The button detects MouseUp events inside the control. However I would like these MouseUp events to be transferred to the...
0
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello Gurus, Using VS2005 with .NET Framework 2.0. I wrote a GUI control A derived from UserConstrol, this control contains another UserControl derived B which contains two Labels controls and...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...

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.