We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resize a tab control to fit the page size?

Thread ID:





13303 Apr 26,2004 09:08 AM UTC Apr 26,2004 06:42 PM UTC WinForms 1
Tags: Tools
Holger Persch
Asked On April 26, 2004 09:08 AM UTC

Hi, I would like to add tab pages to the TabControlAdv at runtime. The problem is how to resize the tab control''s client area respectively the form to fit the page''s size. In the sample the page itself is a user control containing for pairs of labels and textboxes. When the form comes up the fourth label and textbox are hidden, the form must be manually resized to show these controls. How can this be done by code? Thanks in advance, Holger Persch TabTest_5137.zip

Administrator [Syncfusion]
Replied On April 26, 2004 06:42 PM UTC

Hi Holger, I am afraid, there is not single API to easily resize the main form based on the child controls contained in it (such that all of them are visible). The only way to do this would be as follows : 1. Calculate the difference (say, delta values) in the Width and Height values between the TabControlAdv and the main form 2. Set the size of the TabPageAdv to the size of the UserControl (which is already known at designtime) 3. Now set the size of the main form by adding the appropriate delta values to width and height of the main form. I have modified the above sample accordingly and have attached it here. Please try this and let me know if you need further assistance. Regards, Guru Patwal Syncfusion, Inc.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon