OK, this is probably very simple and it's likely that I am very simple, but it's bugging me big time :$ !!!

I have never written anything in VB before, a few things in VBA, but this is my first venture in to VB.net ... so sorry if I am being foolish !!!

I have created a Listbox as I want it, with the data in it as I want it, but there is not, as I would expect, a single downward arrow on the right of the Listbox that I click to "dropdown" the list, instead I have an up & down arrow, so can only scroll up & down through the list, which, IMHO, is horrible & much more difficult to use.

So the simple question is ... how do I get the Listbox to give me "dropdown" option ?!?

Thanks in advance ...

Recommended Answers

All 4 Replies

Use the ComboBox control instead.

Use the ComboBox control instead.

I assume then, in a ComboBox, that I can block the user from inputting his own text & force him to choose one of the options ?!?

Yes. In the designer, go to the DropDownStyle property of the combo box and change it from "DropDown" to "DropDownList."

This can also be accomplished via code.

ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

Yes. In the designer, go to the DropDownStyle property of the combo box and change it from "DropDown" to "DropDownList."

This can also be accomplished via code.

ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

That's brilliant, thanks for your help ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.