If the code is run from more than one event, you should refactor it into a method:
void button1_Click(Object^ sender, EventArgs^ e)
{
// Stuff for button 1
Button2Stuff();
}
void button2_Click(Object^ sender, EventArgs^ e)
{
Button2Stuff();
}
void Button2Stuff()
{
// Stuff for button 2
}
You can also fire an event handler directly since it's just another method:
void button1_Click(Object^ sender, EventArgs^ e)
{
// Stuff for button 1
button2_Click(this, EventArgs::Empty);
}
void button2_Click(Object^ sender, EventArgs^ e)
{
// Stuff for button 2
}