Make DirListBox and FileListBox same size

This is probably quite easy for you experts and is more than likely something I am overlooking.

In my application I have both DirListBox and FileListBox, as these are displayed next to each other I would like to make them the same size(height especially), but when I try to re-size them they jump either to a size that is slightly lower or higher. I have tried selecting them both and then using the format-make same size menu, but this still ends up with one slightly smaller (usually the FileListBox) than the other. I have also tried setting their height at runtime, this has the same effect. How can I get them to be the same height.

Please help even though this is only for aesthetics.

Who is Participating?
cookreConnect With a Mentor Commented:
'Align to Grid' doesn't always give precise results.

Have you tried putting in explicit vaues for the 'height' and 'width' properties?
sounds like this is the kind of thing you've already tried, but give it a go:

dirListBox.height = fileListBox.height
Just copy the values of the Height and Width properties from the properties window of one of the objects, then select the other one and paste it in the appropriate properties.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

MandyP1Author Commented:
Thanks for all your comments but I'm afraid I have tried all these methods. I think the basic cause is due to the spacing between each line of text in the DirListBox as opposed to the spacing in the FileListBox, as they each seem to jump to the next line height - does that make sense? I may be wrong.

Well, poo.  

Yeah, that's why we don't see half lines in those boxes any more.

And it doesn't seem to let you adjust at run time either.
so how about if you make the font sizes the same, then adjust the heights as needed, does that do it?
Therein lies the problem - the font sizes are the same.  It would appears as if the folder icon makes the lines a wee tad taller.
I had faced this problem quite a number of times.

See if this works:
At design time(obviously..)
Go to Tools Menu->Options->General Tab->check the Show Grid(i think it will be by default)
And in the format Grid settings change the Twips width and height to 30 respectively.

Hope this solves yr problem. Give it a try!!


I think it just can't be done :o/
Gues FileListBox has something similar to ListBox "IntegralHeight" property. It means that Height property is changed automatically in that way, it always displays COMPLETE row. While this property in ListBox could be changed, there no way to do it in FileListBox.
MandyP1Author Commented:
Thanks priya, but I had already tried that, infact I think I have tried almost everything. I think I am inclined to agree with both cookre and Rimvis in that it always shows the complete row, and due to the icon the spacing of the rows is differant is it possible to adjust this? This may be one of those thinks that I am just stuck with.

Thanks for your comments.
Hi MandyP1,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept cookre's comment(s) as an answer.

MandyP1, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

EE Admin
All Courses

From novice to tech pro — start learning today.