FIX: Anchored Control on Inherited Form Changes Location When You Recompile (316560)
The information in this article applies to:
- Microsoft .NET Framework SDK 1.0
- Microsoft .NET Framework SDK 1.1
This article was previously published under Q316560 SYMPTOMS After you run or recompile a project, anchored controls may
be restored to their original position on the base form.
When you
create a new Windows Form by inheriting from a base form that has private
anchored controls, you may encounter unexpected run-time and design-time
behavior. When you first resize the inherited form in the designer, the
controls move correctly with the form; however, at run time or when you
recompile, the controls are restored to their original position on the base
form. RESOLUTION You can work around this problem by using one of the
following methods:
- Wait until after you run InitializeComponent to resize the form. Do not resize the form in the
designer.
- In the base form, change the access modifier of anchored
controls (for example, button1) to be Protected in the base class, as follows:
This bug was corrected in Microsoft .NET Framework SDK 1.1.
Modification Type: | Major | Last Reviewed: | 4/8/2003 |
---|
Keywords: | kbfix kbForms kbCtrl kbpending kbprb KB316560 |
---|
|