Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    User form enlarged (Win 2000, Office 2000)

    Hi,

    I have a word template, in which I have a Userform that appears when starting the template.

    In the Userform it is a text box where people (the user) shall type comments (text). When someone type more text than it is visibly possible to see, the text box can be configured such that it can contain many lines for text. But the lines visible are limited by the size of the box.

    Is it possible or does it exist a function such that the user can for example click a button and the text box opens in the size adjusted to the amount of text?

    The box should close again when finished typing in it and became the original box size.

    Thanks for any help in advance!

    bj

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: User form enlarged (Win 2000, Office 2000)

    What a fun request! The part about the box shrinking when it loses focus I did not try to code. The attached example has buttons to expand and contract the box (between 1 and 7 lines). Hope this helps.
    Attached Files Attached Files

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: User form enlarged (Win 2000, Office 2000)

    Thanks a lot.
    This will help. It looks as I can adjust the max height of the enlarged box, changing the code.

    I have seen in Remedy's "Action Request System". An application where they have a command button beside the text box and by clicking this one the box opens in a large form so that one can view all the text typed.

    Any way this will help in most cases.

    Again, thanks a lot!

    Bj

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: User form enlarged (Win 2000, Office 2000)

    Opening a second userform would be easier to code if there are a lot of controls to rearrange... If the text is large, you also could dump it to a temp file and open it in Notepad. This would free your first userform from waiting on another userform, but might confuse users into thinking they can edit in Notepad and "round trip" back to the userform.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Eugene, Oregon, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User form enlarged (Win 2000, Office 2000)

    as another option, you could use the AutoSize property of the textbox to control its size. (setting the width at the end to restore its original width).

    Private Sub btnExpand_Click()
    With Me.TextBox1
    .AutoSize = True
    .AutoSize = False
    .Width = 190
    If .Height > 100 Then
    .Height = 100
    .ScrollBars = fmScrollBarsVertical
    End If
    End With
    ...

Posting Permissions

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