I am writing a new C# 2010 desktop application. This application will allow users to select a file from a specific directory location. I am wondering is there anything in a windows application called 'type ahead' feature? Basically
the user will stat typing a few letters and all the files in a selected directory path will appear. (I am asking this question since this feature is available in web applications.)
If there is this type of a feature, can you tell me what this feature is? In addition can you tell me and/or point me to a reference that will tell me how use the 'type ahead' feature?
Loading
VulpesPosted Jun 27, 2013, 3:41 PM
So, if you were using the OpenFileDialog, the user would either need to select multiple files so you could then use its FileNames property or the strings could be obtained by opening the selected file and reading its contents.
Having obtained your string array, you can then use the AddRange method to add it to the AutoCompleteStringCollection as in the MSDN example.
2. There's an article here by Mahesh on this feature which contains more detail than MSDN:
http://www.c-sharpcorner.com/UploadFile/mahesh/AutoCompletion02012006113508AM/AutoCompletion.aspx
dcPosted Jun 27, 2013, 2:03 PM
1. Can I use the OpenFileDialog along with the autocompletion feature? If so can you tell me how to use those features together?
2. If the autocompletion feature an object you drop on the designer surface or is it a property of a textbox? If so, can you show me some code examples on how to use this feature?
VulpesPosted Jun 27, 2013, 1:49 PM
You may like to experiment with the sample code in this MSDN link for a textbox:
http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.autocompletemode(v=vs.100).aspx