I have a form of c sharp, In winch I have Five Button.I want hit all buttons one by one dynamically.
Please send me complete Code of c sharp.

To programmatically press a button in C#, use the PerformClick() method on each button.


How I perform with iteration
As a Loop

How does this look.

var buttons = new[] { button1, button2, button3, button4, button5 };
Array.ForEach(buttons, b => b.PerformClick());

What you you select all (one by one, but all eventually)? Isnt this a bid odd?

Or did you mean something else?

thanks nick.crane ,You solved the problem .

and Thanks for Lamouche and Mitja Bonca