WinForms anchoring tab control to window borders (should be easy!)

Posted on 2006-05-28
Last Modified: 2008-03-10
I have an application that consists of a window... and inside that window I have a tab control.  When I increase the size of or maximize the window, I'd like the tab control to resize along with the window instead of staying the size I initially set it at.  I got it working so that when I increase the size of the window, the tab control does increase with it (set the tab control's anchor property).  But then I can't shrink the window!  As if the tab control's size gets locked or something.  What's going on here?  Thanks!!
Question by:DiamonDogX
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    "As if the tab control's size gets locked or something."

    Make sure you don't have a "MinimumSize" set for the TabControl or the Form itself.
    LVL 69

    Accepted Solution

    Hi DiamonDogX,

    Do you have any code that stop the the tab reducing its size? You should try to create a new form, place a tab control on it and set its anchor property. It should work properly. If it is, try to replace your tabcontrol on your original form. You might have changed a property inadvertly.


    Author Comment

    Fixed it.  All I did was change the AutoSize property of the form to false.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    746 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

    15 Experts available now in Live!

    Get 1:1 Help Now