Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto complete folder entry for a text box

Without beating about the bush - openFileDialog1 does not allow the selection of folders, and folderBrowserDialog is awful (and for my specific desires - doesn't allow manual entry for the sake of entering an admin share like \\someserver\c$\somefolder

So I wish to use a simple edit box to allow the user to type a path. But I am wondering if there is any built in control or functionality available to a C# windows forms app that will auto-fill folders much like what happens when you type out paths in most file/folder select dialog boxes in Windows (7,8)

I want to explore options that might be available "out-of-the-box" before resorting to downloading third party code/plugins/addons to allow this.

like image 668
MrVimes Avatar asked Dec 26 '22 02:12

MrVimes


1 Answers

Yes, those are built into the TextBox and ComboBox classes as found here:

textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textBox.AutoCompleteSource = AutoCompleteSource.FileSystem;
like image 74
CodeCaster Avatar answered Dec 28 '22 10:12

CodeCaster