Previous | Index | Next 

[PRB] Top property of controls hosted inside an SSTab control is relative to TabPage border

Under VB6, the Top property of controls hosted inside an SSTab control is relative to the top border of the SSTab control. After the migration, however, the Top property of these controls is relative to the top border of the TabPage .NET control that hosts them.

During the migration process, VB Migration Partner automatically compensates for this behavioral difference and adjust the Top property accordingly, so that the control appears in the same position where it was in the original VB6 project. However, when reading or assigning the Top property via code, it’s up to the developer compensating for this detail.

In most real-world cases, the Top property of child controls is read and written to at runtime to perform a smart resize of the parent form or the parent SSTab control. In such cases, it is recommend that you get rid of such resizing code and implement your resizing by means of the Anchor and Dock properties that all .NET controls expose.

 

Previous | Index | Next