+ Reply to Thread
Results 1 to 11 of 11

Force Display of Vertical Scroll Bars

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Force Display of Vertical Scroll Bars

    Hi,

    I have created a form that has two textboxes on. It is used to edit existing data that is selected by a combobox on the same form.

    Is there a way to force the textboxes to show scroll bars if the text exceeds the textbox height or just have them always shown?

    It is difficult to distinguish on some of the data whether the data goes beyond what is visible. Without actually clicking into that textbox the scroll bars will not show.

    Is this possible?

    Thank you in advance
    Last edited by jpruffle; 07-04-2009 at 12:55 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    re: Force Display of Vertical Scroll Bars

    From a recent thread
    http://www.excelforum.com/excel-prog...in-a-form.html

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    re: Force Display of Vertical Scroll Bars

    Thank you for the quick reply.

    I did read that thread but wondered if it was possible for two textboxes to display the scrollbars at the same time? As you can only set the focus on one item I assume not?

    Thank you in advance

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    re: Force Display of Vertical Scroll Bars

    When the textboxes are preloaded with text the scrollbars get a bit fussy.

    If you set the TabIndex to the second textbox and then in the activate event you set focus to the first textbox it appears to work.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    re: Force Display of Vertical Scroll Bars

    Again thank you for the quick reply.

    I tried your method but unfortunately as the data gets changed and loaded after the form has initialised (i.e. to edit it) it doesn't seem to work.

    As an alternative can any code be added so for example if the textbox exceeds 75 in height then show a label "Select for more Info". Or something like that?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    re: Force Display of Vertical Scroll Bars

    you need to post example as I can not guess the order of events occurring with code I can not see.

  7. #7
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    re: Force Display of Vertical Scroll Bars

    The form is part of a very large spreadsheet so I have copied it over to a blank worksheet. However the functionality and data is not present.

    On reflection I would almost prefer the ability to add text if the textbox exceeded a given height is that possible anyway?

    I have attached my file.

    Again thank you in advance.
    Attached Files Attached Files

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    re: Force Display of Vertical Scroll Bars

    Text boxes do not show the scrollbars until they contain text that required scrolling


    I don't understand what you mean.
    I would almost prefer the ability to add text if the textbox exceeded a given height is that possible anyway?

  9. #9
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    re: Force Display of Vertical Scroll Bars

    Apologies.

    The form I attached can be used to add or edit existing data. It is more often used as a quick reference to look at an issue. So the user simply add an ID number and the relevant data is shown.

    As the info and status textboxes do not show scroll bars at a quick glance the user is unable to determine whether there is more information further down without physically clicking into the textbox. I wanted to make that process quicker. I tried your example but I am unsure how when I retrieve the data how to show the scroll bars.

    In relation to my second query in regarding textbox height. I was being stupid! I wondered if it might be possible for vba to know if the text inside the box is greater than say the text height. If so then show a label saying that it is, which again would quickly show the user that they need to click into the textbox.

    Ultimately I'll tell the user to stop being lazy but thought it'd be worth a try.

    Thank you in advance

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    re: Force Display of Vertical Scroll Bars

    This code is the cut down to exclude all the assignments of data I don't have.
    It fills the textboxes with rubbish. Reporting linecount in the labels.

    Just click the combo box and enter "a"

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Force Display of Vertical Scroll Bars

    Thank you very much that will get me on the right track.

    Thanks for your patience

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1