C# controls.add停止程序

C# controls.add停止程序,c#,forms,visual-studio,C#,Forms,Visual Studio,我调试了10次,每次停止该方法的都是controls.add 请帮助我迷路了 private void Deploy() { int x = 10; int y = 10; int yFl = 100; Controls.Remove(STARTGAME); C = new ComboBox[3]; L = new Label[3]; for (int i = 0; i

我调试了10次,每次停止该方法的都是controls.add 请帮助我迷路了

private void Deploy()
    {

        int x = 10;
        int y = 10;
        int yFl = 100;

        Controls.Remove(STARTGAME);

        C = new ComboBox[3];
        L = new Label[3];

        for (int i = 0; i < C.Length; i++)
        {
            C[i] = new ComboBox();
            this.Controls.Add(C[i]);

            C[i].Location = new Point(x, y);
            C[i].Size = new System.Drawing.Size(75, 75);
            C[i].DropDownStyle = ComboBoxStyle.DropDownList;
private void Deploy()
{
int x=10;
int y=10;
int yFl=100;
控制装置。移除(启动名称);
C=新组合框[3];
L=新标签[3];
对于(int i=0;i
很明显,代码更多,但从未到达。它在控件处停止。添加,但在以前的控件上工作。删除


不知道为什么

会出现什么错误?@osenter,你能告诉我你在程序中遇到了什么错误,以及你在相关代码中使用了什么事件吗?如果可能,请提供一个简单的完整代码示例,以便我们重现你的问题。