How can I alter the value of a combobox?

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?
 
T

The Last Gunslinger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top