Aligning text in a box

H

Hank Youngerman

I have a text box that contains instructions on running a program. The
length is larger than I want the userform and textbox to be, so it has
vertical scroll bars. However, when I open it, the text appears from
the bottom up. That is, if only 50% is visible at a time, it shows the
last 50%, and I would like it to show the first 50%.

My code is:

Private Sub ShowInstructions()
Load UserForm1
UserForm1.Textbox.Text = "These are the instructions. In reality they
are many paragraphs long."
UserForm1.show
End Sub


The textbox does have vertical scroll bars, and it is handling line
breaks just fine. It's just the initial positioning of the visible
text that is bad.
 
B

Bob Phillips

Put this in the activate event

TextBox1.SelStart = 0


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

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