Alexis Villar
Alexis Villar

Reputation: 370

Path only on textbox

Is it possible to enter only a File path in textbox using c# (windows application)? Just like the function (IsNumeric) that will only allow the numbers only in textbox. How should I do that?

Upvotes: 0

Views: 103

Answers (1)

Nishil
Nishil

Reputation: 227

There are two properties of TextBox you can make use of

textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
textBox1.AutoCompleteSource = AutoCompleteSource.FileSystem;

This will make your textbox to provide suggestions while you type a path

Upvotes: 2

Related Questions