我想知道如果我需要在类中声明 1000 多个控件对象,那么如何声明它。我有如下课程:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
namespace FinApps
{
public partial class Form1 : Form
{
//Global Area Of Class
// Maximum Limit of Declaration is 1000-
private FinAppsUserControl.FinAppsUserControl side1; //global object of control
public Form1()
{
side1 = new FinAppsUserControl.FinAppsUserControl(); //Initialization
InitializeComponent();
this.panel2.Controls.Add(side1);
}
}
}
如果我要求在 form1 类的全局区域中声明 1000 多个全局控件对象,如上述,那么如何实现呢?