-
August 22nd, 2013, 06:43 AM
#1
dont understand combobox in VS c#
hey all
I have some comboboxes
I have added the collections to them and have written code so that when the selectedindex == 0 etc it will output data to a digital display
what I want, is for the combobox to recognise that by clicking on one of the options in the collection that - that is the selection...
at this stage the only way I know my selectedindex== etc works is by using the private void combobox1_selectedindexchanged (object sender eventargs e) thing but for some reason I cannot figure out how to put that in to the piece of code I want... - if I put it in here it invalidates the float values from the measurementspeed.value=value line...
basically I dont know wht I'm talking about haha
This is what I have down
case "Bil_hast":
_lastVehicleSpeed.UpdateValue(DateTime.Now, value);
measurementSpeed.Value = value;
if (comboBox1.SelectedIndex == 0)
{
digitalbig1.DigitText = value.ToString("F0");
biglabel1.Text = "km/h";
}
if (comboBox2.SelectedIndex == 0)
{
digitalbig2.DigitText = value.ToString("F0");
biglabel2.Text = "km/h";
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|