Board index » delphi » Can I do this, if yes please help

Can I do this, if yes please help

Hello
I have one DirectoryListBox in Form1 and a FileListBox in Form2. When I click
one folder in DirectoryListBox, Files in that folder will be showed on the
FileListBox. Normally the size of Form2 and FileListBox is fixed. What I
want is that the size of Form2 and FileListBox can be adjusted. That means
depending on the number of files in FileListBox, the size of Form2 and FileListBox
will be small or big so that the user can see all files in FileListBox (except
they are bigger than the Window)

If I could, please help.
Thank you for help
Nhuyen

http://www.zfree.co.nz

 

Re:Can I do this, if yes please help


On 11 Jul 2001 22:41:47 +1200, "Nhuyen" <sonphu...@zfree.co.nz> wrote:

Quote

>Hello
>I have one DirectoryListBox in Form1 and a FileListBox in Form2. When I click
>one folder in DirectoryListBox, Files in that folder will be showed on the
>FileListBox. Normally the size of Form2 and FileListBox is fixed. What I
>want is that the size of Form2 and FileListBox can be adjusted. That means
>depending on the number of files in FileListBox, the size of Form2 and FileListBox
>will be small or big so that the user can see all files in FileListBox (except
>they are bigger than the Window)

>If I could, please help.
>Thank you for help

You can do sometthing like that but it will be rather painful
calculations and the user may still have folders that will run outside
the largest area available on the user's screen.  (Ever tried to see
ALL of the windows\system folder in Explorer?)

I'd rather suggest that you make the form and controls resizeable.
make the DirectoryListBox align left, make the FileListBox align
client.  If you put a TSplitter in between them, voila, you've got a
simple Explorer clone.

Stephen Posey
slpo...@concentric.net

Re:Can I do this, if yes please help


- Create an OnChange event handler for the TDirectoryListBox.
- Change the Directory of the TFileListBox on the second form.
- Change the Height of the TFileListBox to FileListBox1.Items.Count *
FileListBox1.ItemHeight + 4.
- Change the form ClientHeight to FileListBox1.Height + margins.

"Nhuyen" <sonphu...@zfree.co.nz> schreef in bericht
news:3b4c2d6b$1@zfree.co.nz...

Quote

> Hello
> I have one DirectoryListBox in Form1 and a FileListBox in Form2. When I
click
> one folder in DirectoryListBox, Files in that folder will be showed on the
> FileListBox. Normally the size of Form2 and FileListBox is fixed. What I
> want is that the size of Form2 and FileListBox can be adjusted. That means
> depending on the number of files in FileListBox, the size of Form2 and
FileListBox
> will be small or big so that the user can see all files in FileListBox
(except
> they are bigger than the Window)

> If I could, please help.
> Thank you for help
> Nhuyen

> http://www.zfree.co.nz

Other Threads