Combobox with list of files

Discussion in 'Questions (Windows Mobile)' started by KevG, Apr 19, 2009.

  1. KevG

    KevG New Member Licensed User

    Hi,

    New to B4PPC and no doubt there's a very simple answer...

    I want to populate a combo box with a list of files from a given directory, let's say "C:\Files\Data\", the files will have a set file extension, let's say "*.cog".
    When the file is selected the contents are used within the program; I'm happy with doing that bit.
    It's the combo box option I'm after and not going down the file explorer route.

    Any thoughts?

    Ta very,

    KevG
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Here:
    Add a ComboBox named ComboBox1 and an ArrayList named ArrayList1.
    Code:
    Sub Globals
        
    'Declare the global variables here.

    End Sub

    Sub App_Start
        Form1.Show
        FileSearch(ArrayList1, 
    "c:\Files\Data""*.cog")
        
    For i = 0 To ArrayList1.Count - 1
            ComboBox1.Add(FileName(ArrayList1.Item(i)))
        
    Next
    End Sub
     
  3. KevG

    KevG New Member Licensed User

    Thanks very much Erel,

    Regards,

    KevG
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice