Reputation: 1373
I want a Form to be resized proportionaly to it's content, so I have set AutoSize
property to true
in GrowAndShrink
mode.
I have a base Form that contains a panel in which there is two bttons:
And another Form that inherits from it:
The problem is that panel containing the two buttons in BaseServiceWindow seems not to be taken in account when using the Autosize property. The result is as you can see: I cannot use the buttons from BaseServiceWindow. Any advice would be appreciated.
Upvotes: 0
Views: 136
Reputation: 6026
In your BaseServiceWindow
form, create a second panel that fills the area above the panel with the two buttons. You will use this new panel to contain a UserControl.
Then, instead of creating forms that inherit from BaseServiceWindow
, make them UserControls instead. Create an base UserControl class for your UserControls to inherit from and include virtual methods for the common behavior.
Finally, inject the UserControl into BaseServiceWindow
. You could have the BaseServiceWindow
constructor accept the BaseUserControl type each of your UserControls inherits.
Upvotes: 1