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!