Hi all,
I've been struggling with some strange VB behaviour for the last two days.
I have created a usercontrol and placed two buttons in it. One is anchored
bottom and right. When place the control on the form all is fine, I dock it
to fill and then resize the form and the last button remains anchored bottom
and right. I then build the project / or run the project and all is OK.
Now I changed the control to accept constituent controls in the form
designer where an instance of the user control exists.
i.e
Imports System.ComponentModel
Imports System.ComponentModel.Design
<Serializable(),
Designer("System.Windows.Forms.Design.ParentContro lDesigner,System.Design",
GetType(IDesigner))> _
Public Class myUsercontrol
Inherits System.Windows.Forms.UserControl
etc
The control on the form can now have textboxes dropped into it, great.....
until you either build or run the form!! The bottom that was anchored now
moves to it's original place on the form, i.e the location it has in the
usercontrol. The anchoring still works, but because the form is bigger than
the usercontrol at design-time, the button is anchored about two inches from
the bottom left of the form, and not down in the corner.
So a lot of investigating later, I decided to replace Resumelayout(false)
with true and it works perfectly!!! Only problem is any changes to the user
control or form will remove this change from the form designer code and it
goes back to false. I guess rightfully so!! but that's also debateable.
This problem is really annoying and I know no way around it. Any help is
GREATLY appreciated.
I am using VS 2003 7.1.3088, .NET framework 1.1.4322. Same problem exists
on W2K prof and WinXP Prof.
Many thanks,
Karl