/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
filter on array
Fra : asd987


Dato : 09-02-05 14:32

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




 
 
Søg
Reklame
Statistik
Spørgsmål : 177549
Tips : 31968
Nyheder : 719565
Indlæg : 6408820
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste