i want from my program to select a listbox item and then update it.i have a list ecoItems.Eco is a class with 2 store variables,one string and one double variable.SetEcoValues is a set Method take two values,one string and one double.i try this code but don’t change anything.any suggestions?
private void Update_Click(object sender, EventArgs e)
{
Eco y;
y = ecoItems.ElementAt<Eco>(listBox1.SelectedIndex);
y.SetEcoValues(textBox1.Text,Convert.ToDouble(textBox2.Text));
listBox5.Items.Insert(listBox1.SelectedIndex, y);
}
}
Using your code and what I would guess is your class, I’d do something like this: