Edit

Share via


Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) Method

Definition

Retrieves the bounds within which the control is scaled.

protected:
 virtual System::Drawing::Rectangle GetScaledBounds(System::Drawing::Rectangle bounds, System::Drawing::SizeF factor, System::Windows::Forms::BoundsSpecified specified);
protected virtual System.Drawing.Rectangle GetScaledBounds (System.Drawing.Rectangle bounds, System.Drawing.SizeF factor, System.Windows.Forms.BoundsSpecified specified);
abstract member GetScaledBounds : System.Drawing.Rectangle * System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> System.Drawing.Rectangle
override this.GetScaledBounds : System.Drawing.Rectangle * System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> System.Drawing.Rectangle
Protected Overridable Function GetScaledBounds (bounds As Rectangle, factor As SizeF, specified As BoundsSpecified) As Rectangle

Parameters

bounds
Rectangle

A Rectangle that specifies the area for which to retrieve the display bounds.

factor
SizeF

The height and width of the control's bounds.

specified
BoundsSpecified

One of the values of BoundsSpecified that specifies the bounds of the control to use when defining its size and position.

Returns

A Rectangle representing the bounds within which the control is scaled.

Remarks

This is a helper method that is called by ScaleControl to retrieve the bounds within which the control is scaled. You can override this method to reuse the ScaleControl scaling logic, but you must supply your own bounds. The default implementation returns scaled bounds that take into account the specified bounds, whether the control is top level, whether the control is fixed width or auto size, and any adornments the control might have.

Applies to

See also