Results 1 to 3 of 3

Thread: Auto expand text box in panel

  1. #1

    Thread Starter
    Addicted Member condonethis's Avatar
    Join Date
    Apr 2010
    Location
    TX
    Posts
    133

    Question Auto expand text box in panel

    Hello all,

    What I'm attempting to do is create a Form with two Panels:

    Left - A autosizing panel with a dock fill richtextbox
    Right - A constant size panel with buttons and features for editing the text

    Effect desired:
    When scaling the size of the form you cannot scale smaller than the initial size of the form, but when expanding the panel on the right is anchored to top right while the richtextbox in the left panel will scale infinitely in either height or width dimensions.

    I am sure this is likely some simple property of the textbox or the panel, but cannot seem to locate it. I have the panel on the right anchored at constant size, but cannot seem to get the panel left to autoscale on dimension change.

    Thanks,
    Chad
    Attached Images Attached Images  

  2. #2
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Auto expand text box in panel

    Set the Anchor property of the autosizing Panel to Top, Left, Bottom, Right (make all of the lines in the box gray).

  3. #3

    Thread Starter
    Addicted Member condonethis's Avatar
    Join Date
    Apr 2010
    Location
    TX
    Posts
    133

    Resolved Re: Auto expand text box in panel

    Thanks works great, no brainer

    Found a way to do it with a timer though, but this is much more efficient.

    Panel1.Width = Me.Width - Panel2.Width - 10
    Panel1.Height = Me.Height
    If Me.Height < Panel2.Height Then
    Me.Height = Panel2.Height
    End If

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width