cmbobox shrink to fit

G

Guest

I have a combo box and sometimes the text it is linked to is longer than the
box. Is there a way I can get the text to "shrink to fit"?
 
F

flyingmeatball

right click on the cell that needs to shrink, click format cells, then
under the alignment tab, check "shrink to fit" at the bottom of the
page.
 
G

Guest

Thanks. However, what I need is the text in the combo box to shrink to fit
the size of the combo box.
 
N

NickHK

Shawn,
I would guess you have a couple of options:
- Set the combox to use a fixed width font. When you load the combobox,
multiply the number of characters in the longest entry by set some set
number. Add some for the left margin and some for the down arrow on the
right. Set the combobox width to this. Or reduce the font size until the
above calculation comes out <= combox.width
- If your list is on a worksheet, make sure the list and combobox have
the same font characteristics. Autosize the list column. Synchronise the
combox width and column width
- Set the combox.ListWidth to a large number so that the full text can be
seen in the list if not in the edit part of the combobox.

NickHK
 

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

Similar Threads


Top