VisualStyleRenderer.GetBackgroundContentRectangle 方法

定义

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

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

参数

dc
IDeviceContext

此操作 IDeviceContext 将使用。

bounds
Rectangle

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

返回

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

例外

dcnull

注解

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

适用于