TextBox alignment

B

Boni

Dear all,
on my form I have 2 textboxes:
Name
FilePath


Near the textbox FilePath there is a browse button and textbox itself is
readonly.
So first user presses Browse and selects path, then he types filename and
when he is typing, the FileName.text is automatically typed into FilePath
after the path.
Problem: If path is too long the FileName.text is not in the visible area of
FilePath. I need the textbox to be rightaligned. But the alignment property
don't help, it seems to only work if the text changed directly by user.
Is thare a way to solve this?
Thanks,
Boni
 
H

Herfried K. Wagner [MVP]

Boni said:
on my form I have 2 textboxes:
Name
FilePath


Near the textbox FilePath there is a browse button and textbox itself is
readonly.
So first user presses Browse and selects path, then he types filename and
when he is typing, the FileName.text is automatically typed into FilePath
after the path.
Problem: If path is too long the FileName.text is not in the visible area
of FilePath. I need the textbox to be rightaligned.

\\\
Me.TextBox2.Text = Me.TextBox1.Text
Me.TextBox2.SelectionStart = Me.TextBox2.TextLength
Me.TextBox2.ScrollToCaret()
///
 
B

Boni

Thanks, just what I wanted!!!
Herfried K. Wagner said:
\\\
Me.TextBox2.Text = Me.TextBox1.Text
Me.TextBox2.SelectionStart = Me.TextBox2.TextLength
Me.TextBox2.ScrollToCaret()
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top