How can I alter the value of a combobox?

  • Thread starter Thread starter Johan Goris
  • Start date Start date
J

Johan Goris

I'd like to change the selected value of a combobox, but it does not work in
this way :

ComboBox c;

c = (ComboBox) ct; // ct is a combobox which is added to a form.

c.SelectedValue = sqlp.Value;



I have even tried to refresh it, but that does not work either. How do i
that properly?
 
Johan said:
I'd like to change the selected value of a combobox, but it does not work in
this way :

ComboBox c;

c = (ComboBox) ct; // ct is a combobox which is added to a form.

c.SelectedValue = sqlp.Value;



I have even tried to refresh it, but that does not work either. How do i
that properly?

Use the SelectedIndex property.

HTH
JB
 
Back
Top