[RESOLVED] select statements in vb.net
I need to add a select box on my vbform. Unfortunatly I can not see anything that seems to match this. The list box seems to be the closest tool but I want the client to only be able to select 1 choice at a time. I also only want 1 value to be able to be viewed at a time but also be able to scroll down to see other choices.
What would be my best tool to use for this?
Re: select statements in vb.net
The ListBox can do all that. The SelectionMode property controls how many and how the user can select items and you can simply adjust the height to display a single item. Having said that, you actually probably want a ComboBox. It looks like a TextBox but with an arrow to drop down a list of options. The user can type into the top section by default, but you can change that by setting the DropDownStyle property to DropDownList.
Re: select statements in vb.net
In doing this how do I eliminate the horazontal scrollbars? I have set that value in the list boxes properties to false but it still shows up. How do I eliminate the horazontal scroll bars but still be able to keep the vertical ones.
Re: select statements in vb.net
Re: select statements in vb.net
Tested in both 2003 and 2005, and as long as the horizontalscrollbar property is set to false, you do not get the scrollbar. Are you sure you did it on the right listbox? Or did you change the correct property?
Re: select statements in vb.net
What is wrong with a combobox for this? You can only select one value and you can have it dropdown to see all other values available to be selected.
Why would this not work?
Re: select statements in vb.net
Either use a DropDownList or a ListBox with the MultiSelect property set to false.