این کد چطوره؟
int i = int.Parse(StepPay.Text);
for (int j = 1; j <i; j++)
{
TextBox t = new TextBox();
TextBox l = new TextBox();
l.Location = new Point(StepPay.Location.X + j + 100, StepPay.Location.Y + j*30);
l.Text = "مرحله ی " +j + ":";
groupBox5.Controls.Add(l);
t.Location = new Point(StepPay.Location.X+j, StepPay.Location.Y+ j*30);
groupBox5.Controls.Add(t);
if (j == 5)
{
while (j < i)
{
int k = 53;
l.Location = new Point(StepPay.Location.X + j - 200, StepPay.Location.Y + j* 30);
l.Text = "مرحله ی " + j + ":";
groupBox5.Controls.Add(l);
t.Location = new Point(StepPay.Location.X + j-300, StepPay.Location.Y + j * 30);
groupBox5.Controls.Add(t);
j++;
}
}