Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) Method

定义

检索缩放控件时的边界。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

参数

bounds
Rectangle Rectangle Rectangle Rectangle

指定要在显示器边界中检索的区域的 RectangleA Rectangle that specifies the area for which to retrieve the display bounds.

factor
SizeF SizeF SizeF SizeF

控件边界的高度和宽度。The height and width of the control's bounds.

specified
BoundsSpecified BoundsSpecified BoundsSpecified BoundsSpecified

BoundsSpecified 值之一,指定在定义控件大小和位置时要使用的控件边界。One of the values of BoundsSpecified that specifies the bounds of the control to use when defining its size and position.

返回

一个表示控件缩放边界的 RectangleA Rectangle representing the bounds within which the control is scaled.

注解

这是一个帮助器方法,通过ScaleControl调用此方法来检索缩放控件时的边界。This is a helper method that is called by ScaleControl to retrieve the bounds within which the control is scaled. 可以重写此方法以重用缩放ScaleControl逻辑,但必须提供自己的边界。You can override this method to reuse the ScaleControl scaling logic, but you must supply your own bounds. 默认实现返回已缩放的边界,这些边界考虑specified到边界,无论控件是否为顶级,控件是固定宽度还是自动大小,以及控件可能具有的任何修饰。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.

适用于

另请参阅