View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Norm Lundquist Norm Lundquist is offline
external usenet poster
 
Posts: 18
Default Listbox Height Question

This is a follow-up to a previous question about How to set a listbox "Top".
(It should have been HEIGHT!)

The following code is in the Initialize event of a user form:
ListBox1.Height = Count * 12 + 2
' For some reason, we must access the height.
MsgBox "ListBox1.Height from init = " & ListBox1.Height, vbInformation,
"List Box Height"
' t = ListBox1.Height

"Count" is the number of items that has been loaded into ListBox1. For some
reason, setting the height does not work unless it is accessed - like in the
"MsgBox" line. I tried setting t = ListBox1.Height, but that does not work.

The height of the listbox is either done correctly when the MsgBox statement
is used; OR it is set to 49.2.

Any ideas on what's happening???

THANK YOU!