I have a ComboBox with two read only values: white fusion and silver fusion.
How do I get the correct method to run based on selecting each one in a ComboBox? The methods are just pulling an Integer from a SQL table and put it into a TextBox.
private void cboOilVehicle_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboVehicle.SelectedIndexChanged == "White Fusion")
{
whiteFusionOil();
}
else
{
silverFusionOil();
}
}
private void cboOilVehicle_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboVehicle.SelectedIndex == 0)
{
whiteFusionOil();
}
else
{
silverFusionOil();
}
}
Edit:
The name of the control must be cboOilVehicle
(Line 1) or cboVehicle
(Line 3), it can't be both. You have to decide which is correct
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With