توی C# چگونه می توان یک آراریه از Button ها بوجود آورد
Printable View
توی C# چگونه می توان یک آراریه از Button ها بوجود آورد
سلام
کد:System.Windows.Forms.Button[] arr = new System.Windows.Forms.Button[3];
System.Windows.Forms.Button item;
for (int index = 0; index < arr.Length; index++)
{
item = new System.Windows.Forms.Button();
item.Location = new System.Drawing.Point(5, 30 * index);
this.Controls.Add(item);
arr[index] = item;
}