How to auto resize textbox and a windows form

Posted on 2012-08-31
Last Modified: 2012-09-04
I have a windows form with a multiline textbox on it. I want textbox to auto grow and expand downwards (the width should not be affected) as the user types in more text, and I want to windows form to grow correspondingly.

Does anyone know how can I accomplish that?
Question by:YZlat
    LVL 49

    Accepted Solution

    LVL 35

    Author Comment

    julianH, the code I got from that link worked great on the textbox but the question remains of how can I make the form grow along with the textbox?
    LVL 49

    Assisted Solution

    by:Julian Hansen
    Have you set the forms AutoSize property to true?
    LVL 35

    Author Comment

    I just tried that and it worked if the textbox is not docked to fill the form. But in my case textbox is docked to fill the form. I had to set Dock to none and now looks like it works. thank you!

    Hopefully it won't break something else that I had to un-dock the form

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now