Why this code in WPF does not work ?
private void button1_Click(object sender, EventArgs e) { MessageBox.Show(\"yes\"); } pr
I think the shortest and most efficient solution to your problem would be simply done in one line.
button1.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
That should work for WPF C#