Dynamically resizing listboxes (1 Viewer)

greaseman

Closer to seniority!
Local time
Today, 02:09
Joined
Jan 6, 2003
Messages
360
I have several forms that use both combo and listboxes. Does anyone know of a method to dynamically resize the height of listboxes? On my forms, I have placed several group (or frame) items, and it would be great to have the list boxes within a respective group (or frame) dynamically expand their height for ease of readability by my users.

Any help or advice is truly appreciated.
 

WayneRyan

AWF VIP
Local time
Today, 08:09
Joined
Nov 19, 2002
Messages
7,122
greaseman,

Me.lstYourListBox.Height = 1000

You'll have to experiment with the values. I think they
are in twps or something.

hth,
Wayne
 

WitchCraft

Registered User.
Local time
Today, 08:09
Joined
Jan 6, 2003
Messages
11
Try to do a count of the length of each line in your listbox : compare to the highest value, if the value is higher change the max to it. Move to nexr

dim intMax as integer

for I=0 to list.count do
if len(list.column(0,I) > intMax then intMax=len(list.column(0,I)
end

list.height=intMax ' <-- (convert it to twips)
 

Users who are viewing this thread

Top Bottom