窗口雙緩衝
Public Sub New()
' 此調用是 Windows 窗體設計器所必需的。
InitializeComponent()
' 在 InitializeComponent() 調用之後添加任何初始化。
SetStyle(Windows.Forms.ControlStyles.OptimizedDoubleBuffer Or Windows.Forms.ControlStyles.ResizeRedraw Or Windows.Forms.ControlStyles.AllPaintingInWmPaint, True)
End Sub
TextBox去除默認右鍵信息
Public Class ClaTextbox
Inherits System.Windows.Forms.TextBox
Public Sub New()
MyBase.New()
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg <> &H7B Then
MyBase.WndProc(m)
End If
End Sub
End Class
正則表達式
'正則表達式
Public Function GetRegex(ByVal txtStr As String, ByVal regStr As String, ByVal groupIndex As Integer) As String
GetRegex = ""
Dim reg As New System.Text.RegularExpressions.Regex(regStr)
Dim matchs As System.Text.RegularExpressions.Match = reg.Match(txtStr)
GetRegex = matchs.Groups(groupIndex).Value
End Function