/
Forside
/
Teknologi
/
Udvikling
/
VB/Basic
/
Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Find en bruger
Stil et spørgsmål
Skriv et tip
Fortæl en ven
Pointsystemet
Kontakt Kandu.dk
Emnevisning
Kategorier
Alfabetisk
Karriere
Interesser
Teknologi
Reklame
Top 10 brugere
VB/Basic
#
Navn
Point
1
berpox
2425
2
pete
1435
3
CADmageren
1251
4
gibson
1230
5
Phylock
887
6
gandalf
836
7
AntonV
790
8
strarup
750
9
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
Alle emner
Teknologi
Udvikling
VB/Basic
Indstillinger
Spørgsmål
Tips
Usenet
Reklame
Statistik
Spørgsmål :
177558
Tips :
31968
Nyheder :
719565
Indlæg :
6408914
Brugere :
218888
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2024 kandu.dk. Alle rettigheder forbeholdes.