Populating a 2nd listbox based on the 1st listbox selection!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • RileyBob
    Forum Member
    • Apr 2005
    • 3

    Populating a 2nd listbox based on the 1st listbox selection!

    Heya again, folks!

    Okay, I'm having a bit of difficulty here...I'm assuming there's an easy solution to this I'm just overlooking. I've created a listbox1 which searches a root directory for subdirectories, then displays the subdirectory names as items in listbox1. What I'd like to do next is take the user-selected item from listbox1 and populate a listbox2 with any *.pdf files currently located in whatever subdirectory that listbox1 item corresponds to.

    I'm assuming I need to somehow assign the full path as a value to each of those items in listbox1 when I populate it, and that at the moment the full path isn't there since I'm using String.SplitPath to get just the subdirectory name to populate the list.....but I could be wrong!

    Any assistance (and specifically an example of the syntax on how to do this) would be very, very much appreciated!!! For reference, below is how I'm arriving at the current items to populate listbox1 with:

    --Checking a primary directory for subdirectories.
    categories = Folder.Find("C:\\Stuff\\", "*", false, nil);
    --Populating my listbox with the "categories".
    for index, value in categories do
    resSplitPath = String.SplitPath(categories[index]);
    result = ListBox.AddItem("ListBox1", resSplitPath.Filename, categories[index]);
    end



    Thanks so so much in advance!
  • RileyBob
    Forum Member
    • Apr 2005
    • 3

    #2
    Okay, I'm dumb...disregard!

    Got it figured out - thanks to any who would've answered! I was being dumb and missing the obvious...got it all set now

    Comment

    • Intrigued
      Indigo Rose Customer
      • Dec 2003
      • 6138

      #3
      Right'O!

      :yes :yes
      Intrigued

      Comment

      Working...
      X