Anchored controls on inherited forms

  • Thread starter Thread starter kjvt
  • Start date Start date
K

kjvt

I have just about given up on using a base form class with anchored
controls! My base form has a protected tab control that I would like
to anchor to all sides of the form. However, the derived forms can be
different sizes. Whenever the project is compiled, the size of the
tab form on the derived forms changes, if the derived form is a
different size than the base.

A KB article (316560 FIX: Anchored Control on Inherited Form Changes
Location When You Recompile) discusses a related problem that is
fixed. Is there any fix or work around for the problem I am seeing?
 
Hi kjvt (random characters?),

I've not tried it but you could have Anchoring off in the Base. In the
Derived, set the initial Location and Size manually in Sub New() and then
switch Anchoring on.

Regards,
Fergus
 
Fergus,

This worked great, thank you. I varied just a bit: I set anchoring to
top & left for all the controls in the base otherwise the location
jumps around at compile time. Then all I had to do in the derived
New() was set the actual runtime anchoring I want, in this case all
sides for my Tab control.

Actually, those are my initials.

On to the next item...

Kees VanTilburg
VanTilburg Enterprises
 
Hi Kees,

|| Actually, those are my initials.

LOL. I thought I might be putting my foot in it! ;-)

Here's to VT Enterprises. Have you a site?

Regards,
Fergus
 
Back
Top