LoukMouk
LoukMouk

Reputation: 512

How to always show end of text in windows form textbox c# (even when not focused)

CONTEXT :

QUESTION :

I want the textbox to always show the end of my selected folder's text even when not in focus.

enter image description here

enter image description here

I'm limited in space and can't stretch the textbox to show all the path.

Here, I would like the textbox to show something like :

...\morneaulo\Desktop instead of C:\Users\morneaulo\Des...

I would also prefer to keep all the available text in the textbox because I use the textbox.Text property when the files are saved.

Upvotes: 2

Views: 1797

Answers (1)

Griswald_911
Griswald_911

Reputation: 119

You could try to set it in code behind like so:

FileTextBox.SelectionStart = FileTextBox.Text.Length;
FileTextBox.SelectionLength = 0;

Upvotes: 2

Related Questions