if (fromListBox.SelectedIndex = 0 && toListBox.SelectedIndex = 1)
input /= 12;
else if (fromListBox.SelectedIndex = 0 && toListBox.SelectedIndex = 2)
input /= 36;
else if (fromListBox.SelectedIndex = 1 && toListBox.SelectedIndex = 0)
input *= 12;
else if (fromListBox.SelectedIndex = 1 && toListBox.SelectedIndex = 2)
input /= 3;
else if (fromListBox.SelectedIndex = 2 && toListBox.SelectedIndex = 0)
input *= 36;
else if (fromListBox.SelectedIndex = 2 && toListBox.SelectedIndex = 1)
input *= 3;
What am I doing wrong? How do I pull data from different listboxes for calculation?
This is a distance conversion application; user inputs a number into the startingDistanceTextBox
, chooses what the measurement it is from the fromListBox
and what they wish to convert it to from the toListBox
; items are: inches, feet & yards(both listboxes). I am to display the conversion in a label.