public override Size GetPreferredSize(Size constrainingSize) { // dont call TextBox.GPS because it will grow and shrink as the text changes. Rectangle bounds = CommonProperties.GetSpecifiedBounds(TextBox); return(new Size(bounds.Width, TextBox.PreferredHeight)); }
internal override Size GetPreferredSizeCore(Size proposedSize) { if (this.image == null) { return(CommonProperties.GetSpecifiedBounds(this).Size); } Size size = this.SizeFromClientSize(Size.Empty) + base.Padding.Size; return(this.image.Size + size); }
public override Size GetPreferredSize(Size constrainingSize) { return(new Size(CommonProperties.GetSpecifiedBounds(this.TextBox).Width, this.TextBox.PreferredHeight)); }
internal override Size GetPreferredSizeCore(Size proposedConstraints) { return(new Size(CommonProperties.GetSpecifiedBounds(this).Width, this.PreferredHeight)); }