Make DirListBox and FileListBox same size

Posted on 2002-06-23
Last Modified: 2010-08-05
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.

Question by:MandyP1
  • 3
  • 2
  • 2
  • +5
LVL 22

Accepted Solution

cookre earned 45 total points
ID: 7101703
'Align to Grid' doesn't always give precise results.

Have you tried putting in explicit vaues for the 'height' and 'width' properties?

Expert Comment

ID: 7101745
sounds like this is the kind of thing you've already tried, but give it a go:

dirListBox.height = fileListBox.height
LVL 18

Expert Comment

ID: 7101912
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.
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.


Author Comment

ID: 7102081
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.

LVL 22

Expert Comment

ID: 7102173
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.

Expert Comment

ID: 7102460
so how about if you make the font sizes the same, then adjust the heights as needed, does that do it?
LVL 22

Expert Comment

ID: 7102557
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.

Expert Comment

ID: 7102754
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!!


LVL 19

Expert Comment

ID: 7102924
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.

Author Comment

ID: 7105528
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.
LVL 49

Expert Comment

ID: 7962794
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

Expert Comment

ID: 8022902
Per recommendation, force-accepted.

EE Admin

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now