|
-
May 24th, 2009, 04:05 AM
#1
Thread Starter
New Member
Update Listbox like the one in start>Run
How do i create a list box like the start menu>run command where as the user types a directory name the drop down displays the content of the directory and keeps on changing as the user types.
-
May 24th, 2009, 04:11 AM
#2
Re: Update Listbox like the one in start>Run
That would be a ComboBox, not a ListBox. Look at the properties whose names start with "AutoComplete" for that functionality.
-
May 24th, 2009, 10:40 AM
#3
Thread Starter
New Member
Re: Update Listbox like the one in start>Run
Thanks a Lot jmcilhinney, i was using a ComboList Box but didnt know that the autocomplete property did this, i was stupid enough to write code in keypress function of the ComboList Box.
Theres just one more question, can i Filter the file type that are suggested to a particular extention ?? Like i want it to suggest and show only excel files, is that possible
-
May 24th, 2009, 11:07 AM
#4
Re: Update Listbox like the one in start>Run
Yes - its all possible. As jmcilhinney says - read up about the autocomplete source and autocomplete mode. That will give you the info you need to implement what you want.
-
May 24th, 2009, 01:30 PM
#5
Re: Update Listbox like the one in start>Run
Code:
comboBox1.AutoCompleteSource = AutoCompleteSource.FileSystemDirectories
comboBox1.AutoCompleteMode = AutoCompleteMode.Suggest
-
May 24th, 2009, 09:27 PM
#6
Thread Starter
New Member
Re: Update Listbox like the one in start>Run
Yes i have already done that, but i want that the dropdown should suggest excel files only.
How do i filter the suggestion
-
May 24th, 2009, 09:31 PM
#7
Re: Update Listbox like the one in start>Run
You'd have to use a custom source and get just the Excel files yourself, using Directory.GetFiles.
-
May 25th, 2009, 05:50 AM
#8
Re: Update Listbox like the one in start>Run
Take a look at this custom control from CodeProject, I think it's exactly what you're looking for.
http://www.codeproject.com/KB/cpp/ExpCombo.aspx
-
May 27th, 2009, 09:35 PM
#9
Thread Starter
New Member
Re: Update Listbox like the one in start>Run
Thank you jmcilhinney, keystone_paul and MaximilianMayrhofer for the help you've provided, i've been able to accomplish the task, thanks to your guidance.
Thanks a Ton Again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|