Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Need Help with VB6 list box and...


Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2008, 11:16 PM
gymamal gymamal is offline
Newcomer
 
Join Date: Apr 2008
Posts: 15
Exclamation Need Help with VB6 list box and...


Hello Everyone! Good Day!

Please help me for this. I am new to vb. I need to delete files on listed in list box in VB. My program index unwanted garbage files in a listbox. Now I need to delete them using kill command. but kill command needs one defined path. all Paths are indexed in list box of files. How can I delete those files using kill command at once?

In a nutshell I want to give listed pathes to kill command.

ex:

d:\myfolder\unwantedfile.exe

is in my list1 box. so how can I give this delete path to kill command?

please help me! I appreciate your help!
Have a nice day & happy coding to all.
Reply With Quote
  #2  
Old 04-05-2008, 01:41 AM
DougT's Avatar
DougT DougT is offline
Ultimate Antique

Administrator
* Expert *
 
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
Default

You can use the ListBox's ListCount property and a loop. For example
Code:
Dim intI As Integer
For intI = 0 To List1.ListCount - 1
   Debug.Print List1.List(intI)
Next intI
Will print each item in the ListBox to the Immediate Window.
__________________
semel insanivimus omnes
S Data in context = Information, S Information in context = Knowledge, S Knowledge in context = Experience
S Experience in context = Wisdom= Data
Reply With Quote
  #3  
Old 04-06-2008, 12:26 AM
gymamal gymamal is offline
Newcomer
 
Join Date: Apr 2008
Posts: 15
Thumbs up Thanks DougT I will try it now!

Hi DougT good day!

Thank you very much for your quick answer. I will try it now, I think this will grately helpful to me.

Thanks again & Best regards!
gymamal
Reply With Quote
  #4  
Old 04-07-2008, 08:35 AM
gymamal gymamal is offline
Newcomer
 
Join Date: Apr 2008
Posts: 15
Default

Thank you sir! thank you very much! It's working! Thanks to grate help. you are the expert. Thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->