Solved

Simple Scrollbar

Posted on 2000-04-13
12
256 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 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