Solved

Simple Scrollbar

Posted on 2000-04-13
12
254 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:saksafon2
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 2711911
Instead of Enable=False, set Locked=True
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2711923
Yeah, I got good results with Locked=True, Scrolbars = 2 - Vertical and Multiline = True

No API stuff needed.
0
 

Author Comment

by:saksafon2
ID: 2711956
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2712086
? it does in my case. What version of VB / operating system are you running?
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2712089
or... what happens if you don't use the mouse but you tab into the text box?
0
 

Author Comment

by:saksafon2
ID: 2712137
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2712528
Leave the Textbox editable and in the KeyPress event set KeyAscii = 0. But be prepared to have blinking!
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2712559
"I'm using VBA from Word '97"

Woohoo... I thought you were using VB. Figure that...
0
 

Author Comment

by:saksafon2
ID: 2712635
Everything else I've asked seemed compatible, and if not, it was easy to figure it out.  

-rick
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2712671
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
 
LVL 2

Expert Comment

by:Crin
ID: 2712758
Hello,
set Text1.SelStart to 0
and Text1.SelLenght to 0
with Text1.Locked = true

This works :)

Sincerely yours,

Crin
0
 
LVL 2

Accepted Solution

by:
Crin earned 25 total points
ID: 2712780
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now