Question Checkedlistbox Refresh/generate

flomme

New member
Joined
Jun 24, 2010
Messages
3
Programming Experience
Beginner
i want to learn/know 2 things

1. I want to know how the checked list box can get generated by a folder full of mp3's

2. I want the search funktion to refresh the list so it is only the typed in textbox1 that are showed but in the same way it is now

i use 1 textbox and 1 checkedlistbox
VB.NET:
Public Class Form1

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged


        'Retrieve the item's Checkedlistbox

        Dim i As Integer = CheckedListBox1.FindString(TextBox1.Text)

        'highligting the matched ones

        CheckedListBox1.SelectedIndex = i


    End Sub
End Class
 
The IO.Directory.GetFiles and IO.DirectoryInfo.GetFiles methods can get you a list of files from a folder. You should read about those methods in the MSDN documentation and then experiment with them a bit, then post back if you have issues.

Your second point doesn't really make sense. You want to search the list or a folder? Exactly what relationship does the TextBox contents have with the files? Is it a full name? a partial name? something else? You want to refresh the list by filtering out certain items? getting new items from the folder? something else?
 
okay i will post if i got some issues :)

if we say its like google when you type somthing in the textbox on google you get a list under it but the list i want is only eg song names fra my folder so if i type bob then in the box under bob marley and bob dylan will appear and it have hided alle the other songs
 
So you're saying that you actually want to remove items from the CheckedListBox that don't match what you've typed? They won't maintain their checked state if and when you add them back in, you realise?
 
Back
Top