语言

VisualStyleRenderer.GetBackgroundExtent(IDeviceContext, Rectangle) 方法

定义

返回当前视觉样式元素的整个背景区域。

public:
 System::Drawing::Rectangle GetBackgroundExtent(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle contentBounds);
public System.Drawing.Rectangle GetBackgroundExtent(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle contentBounds);
member this.GetBackgroundExtent : System.Drawing.IDeviceContext * System.Drawing.Rectangle -> System.Drawing.Rectangle
Public Function GetBackgroundExtent (dc As IDeviceContext, contentBounds As Rectangle) As Rectangle

参数

dc
IDeviceContext

此操作 IDeviceContext 将使用。

contentBounds
Rectangle

一个 Rectangle 包含当前视觉样式元素的内容区域。

返回

一个 Rectangle 包含当前视觉样式元素的整个背景区域。

例外

dc 是 null。

注解

视觉样式可以定义每个背景图像中的内容区域。 这是可以在不覆盖背景边框的情况下放置文本和图标等内容的区域。 此方法使用给定的内容区域计算当前视觉样式元素的整个背景区域。

适用于