I have 1 enum declaration of "car_brands" like this :
public enum Car_brands
{
Audi = 1,
...
...
}
and many others enum declarations of each "car_brand" like this
public enum Audi
{
model_a3 = 1,
model_a4 = 2,
...
}
I have 2 combobox associated. One associated with the car_brands :
comboBox1.DataSource = new BindingSource(Car_brands.Keys, null);
I want the other combobox fill with select brand's enum (exemple Audi's models of Audi Enum).
I try this but it seems not exact...
private void comboBox3_SelectedValueChanged(object sender, EventArgs e)
{
string value = comboBox1.Text; //car brand
Type type = Type.GetType(value);
var brand_models = Enum.GetNames(type.GetType());
foreach (string enumValue in brand_models)
{
string brand_model = enumValue;
MessageBox.Show(brand_model);
}
}