Not sure what the problem is. Clicking on button6 adds a click handler for button7. Clicking on button7 should fire the handler.
Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
Why would you do an even for some button inside other button? This makes no sence.
Events for all the button can be generated on the load time. Or when you create some button in the run time (afterwards).
If you still inisit you can do it:
private void button6_Click(object sender, EventArgs e)
{
//just make sure your button initialized on form!!
this.button7.Click += new EventHandler(button7_Click);
EvenArgs ee = new EventArgs();
button7_Click(this.button7, ee); //this will fire button event!
}
private void button7_Click(object sender,EventArgs e)
{
MessageBox.Show("Button7 Clicked when ur pressing button6");
}
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474