The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

VB6: DirListBox vs FileListBox positions

I’m using a DirListBox and a FileListBox on a form.  They’re positioned next to each other.  But for some or other reason I can’t get their heights the same.  I’ve even gone as far as setting the FileListBox’s height to that of the DirListBox, but where I break the code right after that, and you look at the values, they still differ.
It makes my form look crappy because they don’t line up.
Any suggestions?
Celeste L Send private email
Wednesday, October 12, 2005
 
 
I'm guessing you're doing this because you want a user to be able to select which files to merge (a previous thread) ?

You'd do better to use the LoadFile dialog that is built into windows and accessible from VB.

http://www.garybeene.com/vb/tut-dlg.htm

http://vbnet.mvps.org/index.html?code/faq/cdlgmultiselect.htm
Justin Send private email
Wednesday, October 12, 2005
 
 
I concur using the standard windows dialog is much better and has a lot more features without adding a lot of work to add or maintain.
Rob Conley Send private email
Wednesday, October 12, 2005
 
 
Yes, it’s still that merging app (takes much longer that I’d like to admit!) :(

A common dialog won’t suffice.  The user must be able to select specific extensions, plus the user must be able to select files with a certain string in the name. 
Suppose I can add InputBoxes for those…
(*sigh*)
Please let me know if you have other ideas.
Celeste L Send private email
Thursday, October 13, 2005
 
 
Create a new standard VB project. Add the MS Dialog Control (component) to your project and create a new VB form.

Add the following to the form load event.

With CommonDialog1
    .InitDir = "c:\temp"
    .FileName = ""
    .Filter = "All Files|*.*|Justin Files|*.jjj|Justin US Files|*us*.jjj"
    .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer
    .ShowOpen
End With

When run this will open in the directory c:\temp (make sure there is one). put 3 files in this directory jtest.jjj justin.jjj and justin.txt.

The filter property is a pipe separated list, each pair corresponding to the Files of Type description and filter properties. The example here shows all, all jjj files and any jjj file with "us" in the name.
Justin Send private email
Thursday, October 13, 2005
 
 
I forgot "Add a dialog control to the form", but that should be obvious.
Justin Send private email
Thursday, October 13, 2005
 
 
The user must be able to type the file extensions (delimited by a “;”), and/or type a string to search for in the filename.

To use your example, I’d have to have one Inputbox for the user to enter the extension (the “jjj” in your example), and a second Inputbox for a string in the file name (“us” according to your example).

Would’ve been so much easier if the common dialog had editable fields.

Unfortunately I’ve had to finish the little app.  Couldn’t spend any more time on it.  Doesn’t look too bad – it’s color coded to match other products, and I’ve moved a statusbar over the bottom part of the DirListBox and the FileListBox so you can’t see that they don’t line up.

Classic case of Kamikaze-coding.

(Well, the app was just for one client for one user, so I’ll just have to live with myself for not doing anything smarter.)

Thanks allot for your help.
I’ll definitely post again if I’ve got another teaser.
Celeste L Send private email
Thursday, October 13, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz