ListBox question

W

Woody Splawn

I have a listbox on a form with the dropdown style set to drop down list.
It has two items in it. When the form comes to the screen you do not see
any item listed in the dropdown until you click on the down arrow. Idealy
you would see the first item in the list by default without having to click
on the down arrow. How would I do this?
 
A

Armin Zingler

Woody Splawn said:
I have a listbox on a form with the dropdown style set to drop down
list. It has two items in it. When the form comes to the screen you
do not see any item listed in the dropdown until you click on the
down arrow. Idealy you would see the first item in the list by
default without having to click on the down arrow. How would I do
this?

combobox1.selectedindex = 0
 
W

Woody Splawn

Do me a favor and look in the thread "how do I increment this array" the
last 4 rows I do call your name there (about your treeview).
Cor

I'm sorry Cor. I looked in the message but did not quite understand what
you are getting at.

Thanks for you help here and in other messages.

Woody
 
K

Kevin Yu

Hi Woody,

You can set ComboBox.SelectedIndex to 0 in Form_Load, so that the first
item of the list will be shown by default.

If there's anything unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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