I am trying to migrate myself to C#.
I am having too many issues while trying to create control arrays in C#.
Users may be able to solve this runtime error in the source code below.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Control_Duplicator
{
public partial class ControlDuplicatorForm : Form
{
private ComboBox[] myComboBox;
public ControlDuplicatorForm()
{
InitializeComponent();
}
private void Create_Determiner_Button_Click(object sender, EventArgs e)
{
for (int i = 0; i < myComboBox.Length; i++)
myComboBox[i].Text = "Combo Row Created";
//This generates a runtime error.
}
}
}
Regards,
JohnCTX