次のような「car_brands」の列挙型宣言が 1 つあります。
public enum Car_brands
{
Audi = 1,
...
...
}
このような各「car_brand」の他の多くの enum 宣言
public enum Audi
{
model_a3 = 1,
model_a4 = 2,
...
}
2 つのコンボボックスが関連付けられています。car_brands に関連付けられたもの:
comboBox1.DataSource = new BindingSource(Car_brands.Keys, null);
他のコンボボックスを選択したブランドの列挙型 (例: Audi の Audi Enum モデル) で埋めます。
これを試してみましたが、正確ではないようです...
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);
}
}