TabControlChildAutoSize Property

Started by Rolf Brandt, January 28, 2010, 08:42:14 AM

Previous topic - Next topic

Rolf Brandt

Hi Paul,

in a project with a form with a Tabcontrol (and maybe even a Tabcontrol in Tabcontrol) it can becoming a bit annoying always getting the messages that the size of the child cannot be set because the parentform is not visible. The TabControlChildAutoSize property gets set to false. This means you always have to carefully check before compile if all those TabControlChildAutoSize properties are set to true (which I sometimes forget).

Question: Is there really a need for autosizing the child form in design mode? This might be of advantage if you are using a form with a fixed border to determine the placement of controls. But on a sizable form you anyway need to code this in the WM_Size event. Could this be changed that you can autosize the childform maybe via a menuitem (popup or so) and leave the TabControlChildAutoSize property untouched?

Or is it possible to set the TabControlChildAutoSize property to True at program start?
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Robert Rioja

I also have the same complaint.  It is really a nuisance but I am sure that such a brilliant developer as Paul will figure out how to fix this.  After all, we have all come to expect miracles from him.  All joking aside, I really wish the TabControlChildAutoSize problem can be fixed.

Thanks,
Robert

Paul Squires

I just looked at this - man, what a royal screw up that whole situation is. :)

I didn't even realize that the TabControlChildAutoSize property was automatically being reset to False. Nonetheless, dealing with these resizable tab child pages in the design environment has been problematic for a long time. A couple of revisions ago I had to do a complete code change because the resizing was not exact (it was not fully honoring the different border sizes/widths of the tab control). I changed to using the AdjustRect message for the tab control and now the child tab forms resize very well.

The problem is that now the Tab Control must be visible in order for the AdjustRect message to work properly. If the child tab page is shown in the designer but the form containing the tab control itself is not, then we have a problem - the child tab form will not be sized/resized correctly.

An alternative is to allow the TabControlChildAutoSize property to only be active during runtime and not have any effect during design time. That would be the easy solution. There is no easy way to have the TabControlChildAutoSize property functional in design time and runtime without the parent tab control being active (ie. without knowing the tab control's HWND).

I am open to suggestions.
Paul Squires
PlanetSquires Software

Rolf Brandt

Thanks for the explanation, Paul.

I think there is no real need for the TabControlChildAutoSize property to be active during design time, because in most situations the parent dialog will be resizable.

So I would opt for the easy solution.
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Rolf Brandt

QuoteI didn't even realize that the TabControlChildAutoSize property was automatically being reset to False.
Or would it be even easier to simply deactivate the function that resets the property to false?
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Cho Sing Kum

Maybe also consider the situation where a project has 2 or more forms with tabcontrols. Obviously, not all the forms with tabcontrols can be active during project load.

Paul Squires

Quote from: Cho Sing Kum on January 28, 2010, 12:50:15 PM
Maybe also consider the situation where a project has 2 or more forms with tabcontrols. Obviously, not all the forms with tabcontrols can be active during project load.

Yes, that is the type of problem that exists. If you have several tab controls then in order for the child to be properly sized in the *design* environmnet then it's corresponding tab control also need to be visible. It is certainly a pain in the butt having that restriction.

I am leaning towards making the TabControlChildAutoSize only active at run time. That would solve all of these problems.
Paul Squires
PlanetSquires Software

Rolf Brandt

Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Cho Sing Kum

I just remember you have the auto-size feature coming in v 3.0.7. Will the auto-size works in design mode? How or will this affect?

Paul Squires

Quote from: Cho Sing Kum on January 28, 2010, 02:37:11 PM
Will the auto-size works in design mode?

No, the new size/resize features does not work in design mode... only works at runtime.
Paul Squires
PlanetSquires Software