VisualStyleRenderer.GetBackgroundContentRectangle(IDeviceContext, Rectangle) 方法

定义

返回当前视觉样式元素的背景的内容区域。Returns the content area for the background of the current visual style element.

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

此操作将使用的 IDeviceContextThe IDeviceContext this operation will use.

bounds
Rectangle

一个 Rectangle,它包含当前视觉样式元素的整个背景区域。A Rectangle that contains the entire background area of the current visual style element.

返回

一个 Rectangle,它包含当前视觉样式元素的背景的内容区域。A Rectangle that contains the content area for the background of the current visual style element.

异常

dcnulldc is null.

注解

视觉样式可以在每个背景图像内定义内容区域。A visual style can define a content area within each background image. 这是可以在其中放置文本和图标等内容而不覆盖背景边框的区域。This is the area in which content such as text and icons can be placed without overwriting background borders. 此方法使用给定的背景区域来计算当前视觉样式元素的内容区域。This method uses the given background area to calculate the content area for the current visual style element.

适用于