Results 1 to 3 of 3

Thread: List box height

  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    860
    Thanks
    0
    Thanked 10 Times in 9 Posts

    List box height

    I have a user form with 3 list boxes, height of each = 116 in design mode. I fill the 1st list box with, and the user can move items up or down within a list box, or move from one list box to another.

    When I fill the 1st list box, the height changes to 109.75. When the user moves an item to another list box, the height of that list box then changes to 109.75.

    In design mode, I set the height as I wanted it; it's cosmetically pleasing, and it aligns with other controls. Because 109.75 seems to be what VBA wants, I tried setting the height to 109.75 in design mode. After doing that, the height changes to 101.0.

    I should add that all of these list boxes have 3 columns. When I changed the number of columns from 2 to 3, VBA also adjust the height... an increase on this occasion.

    I'm using Word 2010, but this occurs in Word 2007 as well. Is there a way to ensure that my preferred height remains static, or is this just something that I have to put up with?

    Thanks,
    Richard Barrett

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    This sound familiar, I think it's related to using anything other than the default font face and font size, but I never tried to work out the best solution.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    860
    Thanks
    0
    Thanked 10 Times in 9 Posts
    I always use default font and size. I think this is likely related 1) multiple columns, since the height changed unexpectedly when I added a column; and 2) list style option, with either single or multiple selection. It appears that VBA is ensuring that the height of the box is such that the last list item to display within the list box isn't a partial fit. But there's apparently no accurate way to pre-determine what height VBA is going to set.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •