Simple Scrollbar

This is annoying!  I'm including a textbox on a form  with enable=false that I'd like to be scrollable so that all the information be read without allowing them to change the information.  I've seen many programs use a feature like this for disclaimers and such and I'd like to put one in my own program.
I've tried the KEEPSCROLLBARSVISIBLE but I can't seem to get it.  Yes, I also did put in the command for scrollbarvertical or whatnot.
Thanks!

-rick
saksafon2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CrinConnect With a Mentor Commented:
Of course, place this code after changeing your Textbox.Text if you change it in code, or in UserForm_Initialize subroutine.

Sincerely yours,

Crin
0
 
caraf_gCommented:
Instead of Enable=False, set Locked=True
0
 
caraf_gCommented:
Yeah, I got good results with Locked=True, Scrolbars = 2 - Vertical and Multiline = True

No API stuff needed.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
saksafon2Author Commented:
Close, but the scrollbar doesn't appear as  soon as the form is loaded.  It doesn't appear until you actually click the text box.

Idea?

rick
0
 
caraf_gCommented:
? it does in my case. What version of VB / operating system are you running?
0
 
caraf_gCommented:
or... what happens if you don't use the mouse but you tab into the text box?
0
 
saksafon2Author Commented:
I'm using VBA from Word '97.  When I hit tab the scroll bar appears, but the text inside scrolls to the very bottom.  I tried setting tabindex to 0 but it scrolls to the bottom also.

hM!

rick
0
 
Éric MoreauSenior .Net ConsultantCommented:
Leave the Textbox editable and in the KeyPress event set KeyAscii = 0. But be prepared to have blinking!
0
 
caraf_gCommented:
"I'm using VBA from Word '97"

Woohoo... I thought you were using VB. Figure that...
0
 
saksafon2Author Commented:
Everything else I've asked seemed compatible, and if not, it was easy to figure it out.  

-rick
0
 
caraf_gCommented:
Not at all. You had me running around like a lunatic trying to work out why the heck *my* textbox behaved perfectly and *yours* did not.... If you had told us from the start that you were looking at a VB*A* text box and not a VB text box things would have been a lot clearer.

No hard feelings, but try to be a bit more precise in describing your problem in the future.
0
 
CrinCommented:
Hello,
set Text1.SelStart to 0
and Text1.SelLenght to 0
with Text1.Locked = true

This works :)

Sincerely yours,

Crin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.