Link to home
Start Free TrialLog in
Avatar of saksafon2
saksafon2

asked on

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
Avatar of caraf_g
caraf_g

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

No API stuff needed.
Avatar of saksafon2

ASKER

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
? it does in my case. What version of VB / operating system are you running?
or... what happens if you don't use the mouse but you tab into the text box?
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
Avatar of Éric Moreau
Leave the Textbox editable and in the KeyPress event set KeyAscii = 0. But be prepared to have blinking!
"I'm using VBA from Word '97"

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

-rick
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.
Hello,
set Text1.SelStart to 0
and Text1.SelLenght to 0
with Text1.Locked = true

This works :)

Sincerely yours,

Crin
ASKER CERTIFIED SOLUTION
Avatar of Crin
Crin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial