Hello,
I'm looking for the best way to give an user the possiblity to search in
multiple directories for certain photos. I was thinking about using an array
to do so. This is the Command1_Click - code below.
## ---
Private Sub Command1_Click()
' create an array containing the content of
' two directories
Dim MyVar(), MaxItems As Integer
File1.Path = "c:\my documents\photo-archive1"
File2.Path = "c:\my documents\photo-archive2"
File1.Pattern = "*.jpg"
File2.Pattern = "*.jpg"
MaxItems1 = File1.ListCount
MaxItems2 = File2.ListCount
Let MaxItems = MaxItems1 + MaxItems2
For i = 0 To MaxItems1 - 1
MyVar(i) = File1.List(i)
Next i
For i = 0 To MaxItems2 - 1
MyVar(i) = File2.List(i)
Next i
End Sub
## ---
After this the desired information must be presented. I want to do this in a
ListBox. The user can type in a Text-field (parts of) the name of the photos
he is looking for. The filenames are displayed and by clicking them the
corresponding photo must be shown.
## ---
Private Sub Text1_Change()
' display that selection of the array that
' corresponds with "*" & Text1.Text & "*.jpg"
' use a ListBox (List1.AddItem)
End Sub
## ---
Now I don't know how to write the Text1_Change-code for the selection part.
Perhaps there is a much more easier way for this?
Thanks,
Sjoerd
>> Stay informed about: question about simple array