本文整理汇总了VB.NET中System.Windows.Forms.TabControl.DisplayRectangle属性的典型用法代码示例。如果您正苦于以下问题:VB.NET TabControl.DisplayRectangle属性的具体用法?VB.NET TabControl.DisplayRectangle怎么用?VB.NET TabControl.DisplayRectangle使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.TabControl
的用法示例。
在下文中一共展示了TabControl.DisplayRectangle属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Form1
' 导入命名空间
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Private myTabRect As Rectangle
Public Sub New()
Dim tabControl1 As New TabControl()
Dim tabPage1 As New TabPage()
tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed
tabControl1.Appearance = TabAppearance.Buttons
tabControl1.Location = New Point(25, 25)
tabControl1.Controls.Add(tabPage1)
Controls.Add(tabControl1)
' Gets a Rectangle that represents the tab page display area of tabControl1.
myTabRect = tabControl1.DisplayRectangle
myTabRect.Inflate(1, 1)
AddHandler tabControl1.DrawItem, AddressOf DrawOnTabPage
End Sub
Private Sub DrawOnTabPage(sender As Object, e As DrawItemEventArgs)
Dim g As Graphics = e.Graphics
Dim p As New Pen(Color.Blue)
g.DrawRectangle(p, myTabRect)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
End Class