display the first item in a combobox

C

Claudia Fong

Hi everyone

I have 6 items "inside" the combobox.

I would like to display the first item (eg 2005) when load the form.
Another items in the combobox are 2004,2003,2002,2001 and 2000.

In VB, I only have to write combobox.listitem(0) in the form load and it
will show me the first item, but here in C# is different..

Can someone help me?


Cheers!


Claudi
 
J

John B

Claudia said:
Hi everyone

I have 6 items "inside" the combobox.

I would like to display the first item (eg 2005) when load the form.
Another items in the combobox are 2004,2003,2002,2001 and 2000.

In VB, I only have to write combobox.listitem(0) in the form load and it
will show me the first item, but here in C# is different..

Can someone help me?
ComboBox.SelectedIndex = 0;
 

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