Hallo,
ich schreibe gerade ein Programm, welches einen definierten Pfad(+ Unterverzeichnisse) nach .doc Dateien durchsucht.
Diese werden dann Automatisch in eine Listbox eingepflegt und nach Alphabet sortiert (Ohne Array sondern mit einem Simplen befehl)
Nun möchte ich wissen wie ich den ersten Buchstaben des Alphabet Hervorheben kann.
z.B
Aaa
aaa
aaa
Bbb
bbb
Ccc
Ddd
Danach möchte ich alle Listbox1 Einträge in ein Array schreiben, damit ich es nachher über eine Suchfunktion auslesen kann.
(Das habe ich bereits mal Programmiert. Mir fehlt jedoch nur der übergang von "Listbox1 to Array"
__
PS; Nein, ich bin kein VB-Neulin; Ja, ich habe Google zu diesem Thema schon seit 2 wochen in Bedienung.
Um Hilfe wäre ich sowas von dankbar
ich schreibe gerade ein Programm, welches einen definierten Pfad(+ Unterverzeichnisse) nach .doc Dateien durchsucht.
Diese werden dann Automatisch in eine Listbox eingepflegt und nach Alphabet sortiert (Ohne Array sondern mit einem Simplen befehl)
Nun möchte ich wissen wie ich den ersten Buchstaben des Alphabet Hervorheben kann.
z.B
Aaa
aaa
aaa
Bbb
bbb
Ccc
Ddd
Danach möchte ich alle Listbox1 Einträge in ein Array schreiben, damit ich es nachher über eine Suchfunktion auslesen kann.
(Das habe ich bereits mal Programmiert. Mir fehlt jedoch nur der übergang von "Listbox1 to Array"
Quellcode
- Form2.ListBox1.Sorted = True
- 'Scannt nach .Doc Dateien und trägt es in die Listbox ein
- Dim sFile As String
- Dim sPath As String
- ' Startverzeichnis
- 'sPath = Application.StartupPath
- sPath = "Z:\Formulare HL"
- ' ggf. abschließenden Backslash hinzufügen
- If Not sPath.EndsWith("\") Then sPath += "\"
- ' alle TXT-Dateien im Startverzeichnis einschl. Unterordner
- ' in einer ListBox anzeigen
- For Each sFile In My.Computer.FileSystem.GetFiles(sPath, FileIO.SearchOption.SearchAllSubDirectories, "*.doc")
- ' Dateiname mit relativer Pfadangabe zum Startverzeichnis ausgeben
- Form2.ListBox1.Items.Add(sFile.Substring(sPath.Length))
- Next
- 'Zählt meine Einträge von der Listbox1
- Form2.Label5.Text = Form2.ListBox1.Items.Count
__
PS; Nein, ich bin kein VB-Neulin; Ja, ich habe Google zu diesem Thema schon seit 2 wochen in Bedienung.
Um Hilfe wäre ich sowas von dankbar