U
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!
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!