Results 1 to 4 of 4

Thread: Delete item from listbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192
    How can I delete an (selected) item from a listbox ?
    I have a listbox, filled with file-names, I select one of the items and with a commandbutton I will delete (kill or move) this file. What do I have to do ??

    Regards, K. Lensen

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not sure if you are talking about a listbox or a filelistbox.
    But for a listbox it's simple:
    listbox.removeitem listbox.listindex

    For a filelistbox:

    Kill listbox.path & listbox.filename
    listbox.refresh

  3. #3
    New Member
    Join Date
    Mar 2000
    Posts
    9

    List Box Or File List Box

    What Type Of List Box Are You Using To Display The Files;
    A List Box, Or File List Box.

  4. #4
    Member
    Join Date
    Mar 2000
    Location
    Staffodshire, England
    Posts
    32
    For a filelist box use this:


    Private Sub Command1_Click()
    Kill File1.Path & File1.List(File1.ListIndex)
    File1.Refresh
    End Sub

    Mark

    Good Luck!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width