Solved

Simple Scrollbar

Posted on 2000-04-13
12
255 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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
 
LVL 70

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

785 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