you mean you dont want to write event handler for label
control in side your control, however if some one clicks
on label you should get the click event out of your
control ...
Till some one tells you the real solution, i have a
suggestion to reduce little bit of your pain, write a
macro to write the event handler for your controls,
because all the controls click event can call your one
click event so there is hardly any change in the code
from one control to other controls click event ...
public delegate void MyClick (object
sender, System.EventArgs e);
public event MyClick cClick ;
private void UserControl1_Click(object
sender, System.EventArgs e)
{
if (cClick != null)
cClick (sender,e);
}
private void label1_Click(object sender,
System.EventArgs e)
{
UserControl1_Click( sender, e);
}
private void label2_Click(object sender, System.EventArgs
e)
{
UserControl1_Click( sender, e);
}
Let me know if i should go into how to write a macro
which will take your control name and expand it in to a
click event hadler function ..
Sarosh
-----Original Message-----
I build user control, consists of different things (e.g
label, image, etc.)I want to handle click (and other) events, however I can
not do it until Ido not assign event handler for each control inside me
user contol. Is thereway to do this "smart" just inherit all possible events
from usercontrolclass instead of rewriting custom handlers for each
control inside ???
Thankx
.