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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

13303 Apr 26,2004 05:08 AM Apr 26,2004 02:42 PM Windows Forms 1
loading
Tags: Tools
Holger Persch
Asked On April 26, 2004 05:08 AM

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 02:42 PM

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.

CONFIRMATION

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.

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.

;