Both code in the question and the answer by Mantu are wrong. It should be something like that:
int buttonCount = 5;
Button[] buttons = new Button[buttonCount];
int gap = 10;
int currentX =
for (int index = 0; index < buttonCount; ++index) {
Button button = new Button();
button.Text =
button.Top =
button.Left = currentX + gap;
buttons[index] = button;
this.Controls.Add(button);
currentX += this.Width;
}
This way, you can arrange those buttons by X taking into account their actual width when the text is already set up. Also, pay attention that I did not repeat your "5" anywhere, which would be a deadly sin of programming.
—SA