Is the ListBox control of VBA different from that of VB?

A

An

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.
 
J

Jonathan West

An said:
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.
 
A

An

Thanks!pleased to hear your yes answer.
It takes me a couple of days to learn that.
By the way,do you know if the line space of
listbox in VBA can be changed?
 
J

Jonathan West

An said:
Thanks!pleased to hear your yes answer.
It takes me a couple of days to learn that.
By the way,do you know if the line space of
listbox in VBA can be changed?

Not as far as I know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top