I am trying to create a userform that is reusable by turning on and off diff
objects, and reusing objects
I am running into a little difficulty of resizing the list box for various lengths if items
Example would be if I have a list of items and the longest one is 93 chars long, I need a width of 672
When I have a list that the items are each 5 chars long, I need a listbox width of 92
For simplicity's sake, I am using Courier (supposed to be a monospaced font) pitch is 10. I would have figured that my width
would be simply a matter of finding the longest length in the list and then multiply that times some magical number that
represents the width of the letter (since monospaced, each letter should be the same).
But, with the 93 char long string, the "average length" of each letter seems to be 7.2
(672/93 = ~7.2) but for the shorter words, it seems to be wider at 18 (92/5 = ~18)
Is there a way to have the listbox size itself to the width of the strings?
Thanks
Bruce
objects, and reusing objects
I am running into a little difficulty of resizing the list box for various lengths if items
Example would be if I have a list of items and the longest one is 93 chars long, I need a width of 672
When I have a list that the items are each 5 chars long, I need a listbox width of 92
For simplicity's sake, I am using Courier (supposed to be a monospaced font) pitch is 10. I would have figured that my width
would be simply a matter of finding the longest length in the list and then multiply that times some magical number that
represents the width of the letter (since monospaced, each letter should be the same).
But, with the 93 char long string, the "average length" of each letter seems to be 7.2
(672/93 = ~7.2) but for the shorter words, it seems to be wider at 18 (92/5 = ~18)
Is there a way to have the listbox size itself to the width of the strings?
Thanks
Bruce