Autozise textbox height for multirow input

  • Hi experts,

    I do have a little problem to keep ALL the entered text visible in a textbox, setup for multiline input.
    After initializing the userform, i have a textbox with a height of 20 and a font = Tahoma / Bold / size 10.
    The width of the textbox = 186

    After entering the first text line (3 characters for testing), i press the Ctrl + Enter key, so that i go to the next line (crlf).
    Now i notice that the first line of text is moving a bit up, but still visible.
    if I enter now the second line of text, the first entered text is completely moved up and no longer visible, even due to the fact that I enlarge the textbox heigth in the KeyDown event.
    The more text lines i add the more likely that the second line also disapears from the textbox.

    I tried to set the textbox Autosize to True, but it act the same. First line of text is moving up and no longer visible.
    Is it uberhaupt possible to keep ALL the entered text in the textbox visible, and not moving up?
    if so, how can it be done?

    following code are the used events for this textbox:

    Best regards and thanks for any help.

  • Re: Autozise textbox height for multirow input

    A multiline textbox, by default, will display the text from the top. It sounds as if yours is centered vertically, especially if the text scrolls up...

    Can you attach a sample workbook that displays this issue?


  • Re: Autozise textbox height for multirow input


    thanks for the request, but i can't send you the file.
    i need to confess that it's not a Excel workbook, but a Word Add-in (.dotm). :(
    when trying to attach the file, i get a invalid file message (when i hoover over the RED exclamation mark)
    note also that it need a second file, namely the description of custom labels.

    reason i did ask it here is :
    1) there's no specific WORD forum here (or i missed it)
    2) because userforms and their objects behave identical in each OFFICE program (Word, Excel, Powerpoint, ..),.

    are there any ideas where i have to look at?
    Here are at least the Categorized Behaviour properties for the specific textbox:

    AutoSize: False
    AutoTab: False
    AutoWordSelect: True
    Enabled: True
    EnterKeyBehaviour: False
    HideSelection: True
    IntegralHeight: True
    Locked: False
    MaxLength: 0
    MultiLine: True
    SelectioMargin: False
    TabKeyBehaviour: False
    TextAlign: 1 - fmTextAlignLeft
    WordWrap: False

    sorry if i mislead you.

    anyhow thanks for the reply.

  • Re: Autozise textbox height for multirow input

    The reason I asked for a workbook/document is to see the issue in place. Pointless, or possibly pointless, me trying to recreate it... There are limitations attching Word files so either zip it or rename it to .xls and mention in the post text that is what was done (it'd confuse anybody later trying to open it in Excel).

    Am not interested in any text in the document, just a textbox displaying the issue.

    Even though the issue potentially could occur in any Office product, as it's a document you have the issue with the thread has been moved to the appropriate forum.

  • Re: Autozise textbox height for multirow input

    Hi again,

    I renamed the .ini file to .txt - works fine.
    the XML file could be uploaded but there's a warning sign.
    but i couldn't upload the .dotm file, even if i rename the .dotm file to .txt or .xls or whatever, it won't work.
    i get following error message:
    500[IOErrorEventtype = "ioError" bubbles=false cancelable=false eventphase=2 text= "Error #2038"]

    so, I decided to make some re-arrangements in the userform, made the textbox a lot larger in height to be able to enter 8 text lines before the text disappears as described in previous messages.
    I can live with this approach.

    I did spent a few hours on this approch to see that it finally won't work at all.

    I'm sorry for your lost time, but was convinced that it would be a nice approach, but the odds are against me.

    anyhow, thanks a lot for reading the question and wanting to look at it.
    I would say: issue closed.

    best regards,

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!