Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if text box needs scroll?

Status
Not open for further replies.

jwruble

Programmer
May 29, 2002
16
0
0
US
I have a form that is used as a sort of question and answer system, where the question is listed at the top in a textbox and the answer is entered in another text box.

My current problem is that sometimes the questions are very long, and therefore the user must scroll down to view it all. However the vertical scroll bars only show up in that text box has focus.

Is there any way to either keep the scroll bars visible the whole time or to check if the question is bigger than the box and make text appear somewhere on the form that says "scroll down". That way the user will know that there is more to read.

Sort of a random concept, but I was hoping somebody had a suggestion.
 
Hi jwruble,

don't know of a way to always show the scrollbars of a textbox, but the additional text to be displayd if the text in the box is longer than a certain number of characters, is easy:

add a label on your form like "theres more to read ..."

find out the number of characters, that can can be read in your textbox without scrolling (let's assume it's 150 characters.)

in the forms on current event, add the following code:

Code:
Private Sub Form_Current()

if len(me.mytextbox) > 150 then
me.mynotifylabel.visible = true
else:
me.mynotifylabel.visible = false
end if

end sub

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
[blue]Database_Systems and _Applications shared across all Business_Areas[/blue]
 
Thanks Martin! That was exactly what I was looking for. I appreciate the input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top