List Box / Combo Box

  • Thread starter Thread starter -Michelle-
  • Start date Start date
M

-Michelle-

This may be a silly question, but I need to know

I have a number of listboxes that i need to put on a form.

I would prefer to use combo boxes because they don't take up so much room,
but I need to be able to multiselect, hence using list boxes. (If I can
multiselect using comboboxes, I'll be happy to hear about it).

Is there a way that when the user put focus on the list box, the height of
the listbox will drop down, so that more than a single item can be seen, and
when the focus is lost again, reset the height back to a normal one item
height?

TIA
Michelle
 
You can put code in the listbox's GotFocus event to increase the control's
Height, and then decrease it again in the listbox's LostFocus event.

Private Sub lstNames_GotFocus()
Me.lstNames.Height = 960
End Sub

Private Sub lstNames_LostFocus()
Me.lstNames.Height = 240
End Sub

(And no, there's no way to multiselect using comboboxes)
 
Thanks for your information Doug


Douglas J. Steele said:
You can put code in the listbox's GotFocus event to increase the control's
Height, and then decrease it again in the listbox's LostFocus event.

Private Sub lstNames_GotFocus()
Me.lstNames.Height = 960
End Sub

Private Sub lstNames_LostFocus()
Me.lstNames.Height = 240
End Sub

(And no, there's no way to multiselect using comboboxes)
 
Back
Top