本文整理汇总了VB.NET中System.Windows.Forms.VisualStyles.VisualStyleRenderer.GetBackgroundRegion方法的典型用法代码示例。如果您正苦于以下问题:VB.NET VisualStyleRenderer.GetBackgroundRegion方法的具体用法?VB.NET VisualStyleRenderer.GetBackgroundRegion怎么用?VB.NET VisualStyleRenderer.GetBackgroundRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.VisualStyles.VisualStyleRenderer
的用法示例。
在下文中一共展示了VisualStyleRenderer.GetBackgroundRegion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SetClipRegion
' Calculate and set the clipping region for the control
' so that the corners of the title bar are rounded.
Private Sub SetClipRegion()
If Not Application.RenderWithVisualStyles Then
Return
End If
Using g As Graphics = Me.CreateGraphics()
' Get the current region for the window caption.
If SetRenderer(windowElements("windowCaption")) Then
Dim clipRegion As Region = _
renderer.GetBackgroundRegion(g, _
elementRectangles("windowCaption"))
' Get the client rectangle, but exclude the
' region of the window caption.
Dim height As Integer = _
CInt(clipRegion.GetBounds(g).Height)
Dim nonCaptionRect As _
New Rectangle(ClientRectangle.X, _
ClientRectangle.Y + height, _
ClientRectangle.Width, _
ClientRectangle.Height - height)
' Add the rectangle to the caption region, and
' make this region the form's clipping region.
clipRegion.Union(nonCaptionRect)
Me.Region = clipRegion
End If
End Using
End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms.VisualStyles,代码行数:31,代码来源:VisualStyleRenderer.GetBackgroundRegion