📄 linebase.vb
字号:
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Data
Imports System.Windows.Forms
Namespace Microsoft.Samples
''' <summary>
''' Summary description for LineBase
''' </summary>
Public MustInherit Class LineBase
Inherits Control
Private m_thickness As Integer
Private m_antiAlias As Boolean
Protected pen As Pen
Public Sub New()
InitializeComponent()
SetStyle(ControlStyles.SupportsTransparentBackColor Or ControlStyles.ResizeRedraw, True)
SetStyle(ControlStyles.Selectable, False)
Thickness = 1
m_antiAlias = True
BackColor = Color.Transparent
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso pen IsNot Nothing Then
pen.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
<Category("Line Properties"), DefaultValue(True)> _
Public Property AntiAlias() As Boolean
Get
Return m_antiAlias
End Get
Set
m_antiAlias = value
Invalidate()
End Set
End Property
<Category("Line Properties"), DefaultValue(1)> _
Public Property Thickness() As Integer
Get
Return m_thickness
End Get
Set
m_thickness = value
Invalidate()
End Set
End Property
#Region "Component Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
'
' LineBase
'
Me.Name = "LineBase"
AddHandler Me.Paint, AddressOf LineBase_Paint
End Sub
#End Region
Protected MustOverride Sub LineBase_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -