sql
ajax
python
linux
xcode
android
ruby-on-rails
flash
html5
algorithm
facebook
oracle
cocoa
delphi
apache
php5
api
jsp
postgresql
dom
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
cboOilVehicle
cboVehicle
Try this below
if(cboVehicle.SelectedItem.Text == "White Fusion") { whiteFusionOil(); } else { silverFusionOil(); }
If you are going to be comparing the text directly, use the Text property of the combobox:
Text
private void cboOilVehicle_SelectedIndexChanged(object sender, EventArgs e) { if (cboVehicle.Text == "White Fusion") { whiteFusionOil(); } else { silverFusionOil(); } }