Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Question

Status
Not open for further replies.

Kliot

Programmer
Jan 10, 2003
622
US

You can have 3 styles on with a combobox, Simple, DropDown and DropDownList.

With a DropDown Style, when you click on the text portion you can select, type, etc into the text box, the dropdown list only appears when you select the down arrow on the right side of the combobox.

With a DropDownList Style when you click the text portion the or the down arrow the dropdown list appears.

I want the DropDownList to behave like the DropDown, any ideas how to get the DropDownList to only show the dropdown list when the arrow is clicked?

I could use a DropDown instead of the DropDownList but I want to restrict the input to only items in the list, I don't want my users to enter things that are not in it.

Thanks
 

Set the combobox to DropDownList

Set the AutoCompleteMode property to either AutoCompleteMode.Suggest or AutoCompleteMode.SuggestAppend

Set the AutoCompleteSource as appropriate - e.g., use AutoCompleteSource.ListItems if the items are entered in the combobox's list.


Now users can type in the box, but only select items in the list.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 

Thanks for the help but I think you are missing what my problem is. My comboBox is set this way and users can only type in from the list as I want. The problem is when the comboBox is set to DropDownList and they click on the text portion of the ComboBox the dropdown list opens up. If it is set to DropDown the list doesn't open, this is the behavior I want the DropDownList to have. I want the user to have to click on the down arrow to open the list.

Perrin
 
My two cents is to say, "don't bother trying to redesign standard Windows controls." It's a good thing that the same control can be expected to perform similarly across different applications.
 

Sorry RiverGuy, I usually agree with you but not on this one.

With that logic we would still be using DOS, if we wait for Microsoft to decide how or when Standard Controls should be changed they never would be.

If anything I don't want to change the control, I won't the control be behave consistently across styles.

Thanks for the 2 cents.
 
He didn't say don't improve things. The point is that you tend to confuse/aggravate the user and spend more time trying to code around something that is expected of a windows control of that type. Only someone that has felt the same as you is going to have an answer for you and it isn't likely to be an easy one. It is the common behavior of a drop down control that if it gives you a list of options that I can see the options. This becomes more aggravating that if I am restricted only to that list that anytime I need to see that option I would have to click the down arrow.

A program I used not to long ago did something similar and gave no indication that you were restricted to the list. I used several unpleasant words to describe them. They couldn't hear it so they likely don't care, but needless to say it looks bad on them. I have enough aggravation throughout the day one more is not needed.

While I don't agree with what your asking the only suggestion I could give would be doing some type of TextBox and ListBox combo control. The list box then only becomes visible when they click your down arrow. I however know of no way to make the existing control behave the way you want.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Consider this, a user has a form with two comboboxes on it, both comboboxes look identical. One is set to DropDown and the other to a DropDownList.

The user clicks on the text portion of the first combobox and that text portion of the combobox becomes active. They then click on the text portion of the second combobox and the dropdown list shows up and the text portion is not active. The user can activate the list by clicking the down arrow on both comboboxes. The user can also type a name from the list in the text portion of both comboboxes.

I'm simply trying to get the comboboxes to have CONSISTENT behavior, consistent behavior rarely confuses end users. Confusing users is often best left up to Microsoft.
 
The question is where is the indication on the second combo box that it requires a selection from the list? I would expect the second combo box to show a list because I can only type from that list. That is why the combo box works like that it is instant feed back that the list are my only choices.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top