Ross made a good comment on my Scrolling ListBoxes post about when to use a ListBox and when to use a ComboBox.
I started thinking about how I decide which to use, but haven’t had much luck defining my unified theory. At the simplest level, I think Comboboxes were intended to be a control that users could select from a list or type in their own text. ListBoxes, on the other hand, were just for selecting from a list.
That, of course, is too simplistic of a view. The fundamental difference in a appearance of these two controls probably has more to do with which one is used than anything else. Also, ComboBoxes have a MatchRequired property, which makes it the same as a listbox with respect to user-entered text. (I believe the name ComboBox comes from the fact that it is the combination of a TextBox and a ListBox. Requiring a match with the list destroys the TextBox part of the combination.)
I trolled around Excel to see what the pros use in different situations.
|File>Page Setup||Edit>Goto||Edit>Move or Copy Sheet|
|Data>Get External Data|
Okay, that doesn’t help much. I hoped to see some overriding characteristic that determined which control was most suitable, but it eludes me. Here’s my preliminary list of considerations:
- MultiSelect capabilities – If you need multiselect, you pretty much have to go with a listbox.
- Space considerations – Even if you have room for ListBox, it may not be the best choice. But if you don’t have room, that decides it.
- View nearby entries – I think of this as keeping the user informed what his choice was (and wasn’t). The user selects a customer and another control populates with all that customer’s projects. I tend to go with ListBoxes in this scenario.
- Emulation/Standardization – If I want a control with all the references in a VBAProject, I will probably choose a ListBox because that’s what Excel uses for the same task.
- Natural or artificial key – Whenever the selected item is an artificial key, I use a ComboBox. For instance, I’ll use a ComboBox to select a customer ID which populates TextBoxes with name, address, etc. The ID isn’t the desired information, it’s just a means of getting to it, so I keep its display low profile.
- Transfering elements – Whether moving entries in a control up or down, or moving entries between two controls, ListBoxes seem to be the way to go. It kind of relates to the nearby entries consideration. The user simply has to see that the entry is in its new location and not in its old location.
This isn’t my bible of control selection considerations. In fact, I just made it up. I thought about what situations made sense for which controls in projects that I’ve done and tried to codify why I made that “intuitive” choice when I did.
I’m sure graphic designers have some basic rules that they learn in GD101. I didn’t choose those classes as my electives and Calculus and Astronomy didn’t help much in this regard. It would be nice to see what considerations graphic designers make when laying stuff out, or if it’s a fuzzy process that takes some inherent creative talent. For my sake, I hope it’s not the latter.
What considerations, if any, do you make when you place controls on a userform?