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
close icon

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

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

1 Reply

AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon