Re: Is the ListBox control of VBA different from that of VB? by Jonathan
Jonathan
Wed Jun 07 04:42:53 CDT 2006
"An" <ayk@bzmc.edu.cn> wrote in message
news:utC8iygiGHA.4304@TK2MSFTNGP03.phx.gbl...
> Sorry,tittle error!
> During a question of discussing setting line space in a listbox
> of VBA,I realized (not very sure)that the ListBox control of VBA
> is different from that of VB?The reason is the class name of ListBox
> in VBA isn't the same as that of in VB.So I guess they are two
> different kinds of controls.
Yes, they are different controls. For instance the VBA listbox cannot be
populated by a single assignment of a Variant holding an array of values to
the listbox's List property.
There are other differences as well. One of the other key differences is
that the VBA listbox is "windowless", and so the Windows API tricks that
have been published on the web for manipulating VB listboxes won't work on a
VBA listbox.
Be aware that VBA UserForms are not quite the same as VB Forms, VB and VBA
CommandButtons are not the same, nor Comboboxes or Labals etc. In many cases
they are very similar, and having used one in VB you will usually have a
good idea how to use the equivalent in VBA, but there are these occasional
differences that can trip you up.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup