Your question is ambiguous. I need an exact full type name to give an exact answer. However, chances are, the solution is:
Size
(or
Width
and
Height
) is not enough and is not even required. You can prescribe fixed size by setting the properties
MinimumSize
and
MaximumSize
to the same constant value.
[EDIT: After clarification]
All right, this is the class
System.Windows.Forms.UserControl
:
https://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol%28v=vs.110%29.aspx[
^].
Do this, for example:
public class MyClass : UserControl {
public MyClass {
defaultSize =
}
protected virtual Size DefaultMaximumSize {
get { return this.defaultSize; }
}
protected virtual Size DefaultMinimumSize {
get { return this.defaultSize; }
}
Size defaultSize;
}
—SA