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,
ADAdministrator Syncfusion Team April 26, 2004 01:42 PM
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.