|
-
Jul 31st, 2000, 07:47 PM
#1
Thread Starter
Hyperactive Member
-
Jul 31st, 2000, 08:42 PM
#2
Code:
Needed: FileListBox, Command Button, Label
Private Sub Command1_Click()
On Error Resume Next
For i = 0 to File1.ListCount
Label1.caption = File1
File1.ListIndex = File1.ListIndex + 1
Next i
End Sub
-
Jul 31st, 2000, 09:40 PM
#3
Thread Starter
Hyperactive Member
Thnaks, but...
Thanks for the reply, but it has some side effects... the first thing, is that if I move my mouse while it's listing(deleting) the files, they speed up. Now this is not that big problem, but at the end, the command button renames it self to the last file in the List1...
Do you know how can I fix this?
Thanks!
-Emo
-=VB6 Enterprise Edition=-
-=VC++6Enterprise Edition=-
«¤E³m°O²™¤»
-
Jul 31st, 2000, 09:56 PM
#4
Code:
Private Sub Command1_Click()
On Error Resume Next
For i = 0 to File1.ListCount
Label1.caption = File1
File1.ListIndex = File1.ListIndex + 1
Next i
Command1.caption = File1
End Sub
If you'd rather have it listing the files you are "deleting":
Code:
Needed: Listbox, Command Button, Label
Dim FileFinder
FileFinder = Dir("C:\Windows\*.*")
Do Until FileFinder = ""
List1.AddItem LCase("C:\Windows\" & FileFinder)
Label1.Caption = "Deleting " & FileFinder & "....."
FileFinder = Dir
DoEvents
Loop
Label1.Caption = "C:\Windows\*.* - DELETED!"
If you want it a bit slower, but a bit faster:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim FileFinder
FileFinder = Dir("C:\Windows\*.*")
Do Until FileFinder = ""
List1.AddItem LCase("C:\Windows\" & FileFinder)
Label1.Caption = "Deleting " & FileFinder & "....."
FileFinder = Dir
DoEvents
Sleep 30
Loop
Label1.Caption = "C:\Windows\*.* - DELETED!"
End Sub
[Edited by Matthew Gates on 07-31-2000 at 11:06 PM]
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
|