Form resize not working correctly after upgrading to Framework 1.1
Hi all,
I Generic form contains two panels. The lower panel (with fixed height) contains buttons, the upper panel is empty but set to fill the rest of the form space.
In this form I have a function to set any User control I want in the upper panel. Then it resizes the form accordingly to see the entire user control and the lower button panel.
Here is the function:
public void SetControl( Control ctrl ) {
_upperPanel.Controls.Add( ctrl );
// Size the window according to the new panel
int deltaW = ctrl.Width - _upperPanel.Size.Width;
int deltaH = ctrl.Height - _upperPanel.Size.Height;
this.Size = new Size( this.Size.Width + deltaW, this.Size.Height + deltaH );
}
This was working perfectly with .NET 1.0. However I noticed that after upgrading to .NET 1.1, the height of the form was not working anymore. It was missing a little. What is weird is that the width is resizing correctly. And if I copy the resizing code above (3 last lines) twice in the same function it works.
Any ideas?
Thanks,
Hugo
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

joy.simpsonRank #4,292 · 353 reputationPosted Aug 17, 2004, 3:01 PM EDT
hugo_charbonneau3 reputationPosted Aug 18, 2004, 5:42 AM EDT