So, if I understand you, you want to respond to the "Click" event of
the UserControl itself.
If that's so, Seraph just showed you how to do it for a dynamically
created button. Just do exactly the same thing, substituting your
UserControl for Seraph's Button.
If I misunderstand, then maybe you could post the code to your
UserControl and explain in more detail what it is you want to do.
conckrish@gmail.com - 28 Dec 2005 06:53 GMT
Dera Bruce,
Yes, I want to respond to the Click event of the UserControl
itself.If I click on the User Control it ll do some action...Plz tell
me How to do??
Bruce Wood - 28 Dec 2005 23:51 GMT
Well, just do exactly what Seraph showed you, but with your
UserControl:
MyUserControl user = new MyUserControl();
user.ID="user";
this.Controls.Add(user);
user.Click += new System.EventHandler(this.user_Click);
and then, somewhere in your code:
private void user_Click(object sender, System.EventArgs e)
{
... do whatever you want when the butotn is clicked ...
}
conckrish@gmail.com - 28 Dec 2005 06:54 GMT
Dear Bruce,
Yes, I want to respond to the Click event of the UserControl
itself.If I click on the User Control it ll do some action...Plz tell
me How to do??