I am new to C# and stuck on this:

I have an array in my Dealership class that accepts user input for make, model, and year.

class Dealership
    {
        public static Car[] car = new Car[500];
        public static int carIndex = 0;
    }
public partial class FormAddCar : Form
{
 Dealership.car[Dealership.carIndex] = new Car(textBoxMake.Text, textBoxModel.Text, Convert.ToInt16(textBoxYear.Text), Convert.ToInt32(textBoxMileage.Text));
            Dealership.carIndex++;
}

I want a combo box to display these individually (make, model, year) and have looked up many examples with no success.
This is what I have so far...

public partial class FormSearchInventory : Form
{
private void comboBoxMake_SelectedIndexChanged(object sender, EventArgs e)
{
comboBoxMake.Items.AddRange(xxxxx);
}
}

HELP!

Nevermind.. Solved.

for (int i = 0; i < Dealership.carIndex; i++)
                comboBox1.Items.Add(Dealership.car[i].Make);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.