|
-
Sep 26th, 2000, 02:29 AM
#1
Thread Starter
Fanatic Member
I need to add to my app a ListView that will navigate
through the user's files.
By clicking on the file or folder icon, the
file/folder will be in focus, and I will be able to
open them, extract them and such...
-
Sep 26th, 2000, 03:06 AM
#2
Fanatic Member
Have you tried...
the 'FileListBox' control (Which can be used in conjunction with the 'DirListBox' and 'DriveListBox'.
Better still, why not use the MS 'CommonDialog' control as this does the whole job for you.
-
Sep 26th, 2000, 03:59 AM
#3
Thread Starter
Fanatic Member
I have suggested that, but my boss wants it to be with a
listbox to make it look better.
-
Sep 26th, 2000, 04:20 AM
#4
Fanatic Member
Ermm...
What is it exactly you want to know then? How to populate a list view control? How to find out directory contents?
It's not clear what it is exactly you want to do.
-
Sep 26th, 2000, 04:52 AM
#5
Thread Starter
Fanatic Member
I'll explain:
I need the list view will show a list of files and folders
in a drive. Then by dblClicking on a folder, the listview box will go to content of the folder. By clicking on a
folder or file, the file/folder will be in focus and will
be able to change the file or folder.
For etc, WinZip's listview shows zipped files and folders.
Then, if you click on a file and click "Extarct" it does
something to the file (Unzip it). right?
-
Sep 26th, 2000, 05:02 AM
#6
transcendental analytic
Code:
'in declarations
private path as string
'to populate a listview with directories and files...
Dim a As String
a = Dir(path, vbHidden Or vbDirectory)
Do While Len(a)
If GetAttr(a) And vbDirectory Then
ListView1.ListItems.Add a & ", Directory"
Else
ListView1.ListItems.Add a & ", File"
End If
a = Dir
Loop
Now here's something to start with
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 26th, 2000, 06:05 AM
#7
Try downloading the COMcache Xplorer Control Set from ComponentSource.
It includes three FREE controls where one is the CCXploreListView which mimic the right hand pane of Windows Explorer.
You might have to register at ComponentSource before you're allowed this download, but the registration is free as well.
Best regards
-
Sep 26th, 2000, 03:56 PM
#8
Thread Starter
Fanatic Member
Thanks Joacim!
But tell me, how do I make the listview control
in it to go to a certain folder and show it's content?
[Edited by dekelc on 09-27-2000 at 02:24 AM]
-
Sep 27th, 2000, 02:27 AM
#9
There are three importent properties here. They are:[*] CurrentFolder[*] CurrentNameSpace[*] CurrentType
You set the CurrentFolder to any path that you want to see in the listview.
If you want to see a NameSpace folder such as the Control Panel or the Recycle Bin you set the CurrentNameSpace property to the correct name space.
The CurrentType determents if you should use the CurrentFolder or the CurrentNameSpace. Just set it to one of these values:[*] 0 - ccFolder[*] 1 - ccNameSpace
Good luck!
-
Sep 27th, 2000, 06:35 AM
#10
Thread Starter
Fanatic Member
What is "correct name space"?
-
Sep 28th, 2000, 01:48 AM
#11
Originally posted by dekelc
What is "correct name space"?
??????????????? Que ????????????????????
What do you mean by "correct name space". The properties was CurrentNameSpace, CurrentFolder, and CurrentType.
-
Sep 28th, 2000, 03:25 AM
#12
transcendental analytic
Yeah, whats namespace??
Code:
'in declarations
private path as string
'to populate a listview with directories and files...
Sub RefreshList()
Dim a As String
listview1.listitems.clear
a = Dir(path, vbHidden Or vbDirectory)
Do While Len(a)
If GetAttr(a) And vbDirectory Then
ListView1.ListItems.Add a
Else
ListView1.ListItems.Add a
End If
a = Dir
Loop
End sub
Now if you just changed this a bit so that you don't have the ", directory" and stuff shown then you could just test the path and then repopulate the list with files and subdirs from the new path.
Code:
Private Sub ListView1_ItemClick(ByVal Item As ComctlLib.ListItem)
If GetAttr(Path & "\" & Item.Text) And vbDirectory Then
Path = Path & "\" & Item.Text 'It's a folder, go into it
Else
'It's a file, do somthing else?
End If
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|