This is good - I was wondering if there was a way to dynamically resize a
label box but didn't know how. Now I have an idea.
I like the idea, and think it's doable, and accomplishes what I want nicely.
The only question or thing I'm not sure about is in the calculation, exactly
what the 2nd part does:
> Me.Label2.Height = Me.Controls("List" & i).Top - Me.Label2.Top
^^^^^^^^^^^^^^^^^
Not sure what the .controls is returning or the ("list" &i) does. (Being
mostly a C/C++ programmer background, I look at this and assume bit-wise
and...and w/ VBE, I'm sure that's not what it's doing. I'm relatively new to
VBE... :)
But I understand what you're doing, and was thinking along similar lines -
just don't know how to pull some of these value (like box.top) and resize
them. But so far very helpful! Gives me direction on what to play with.
Thanks!
(And could you explain that one part of your calculation a bit more? Thanks.)
> Here is a way I came up with to do it:
> Create 2 "big" empty labels (no text) for the background of your list. Set
[quoted text clipped - 52 lines]
> >
> > Thanks again.
K Dales - 22 Mar 2006 14:15 GMT
I deliberately named the list items with a common prefix and numeric suffix
so I could use them with a numeric index as a "pointer" to the correct list
item. Me is, of course, the userform, the Controls collection is a
collection of all controls on the form (which includes command buttons, text
boxes, etc... including labels). So if i is the number set by your routine
to indicate a particular item in the list, the label containing its value is
named "List" & i (in VBA the & concatenates strings).
Hope this explains.

Signature
- K Dales
> This is good - I was wondering if there was a way to dynamically resize a
> label box but didn't know how. Now I have an idea.
[quoted text clipped - 75 lines]
> > >
> > > Thanks again.