16,555
社区成员
发帖
与我相关
我的任务
分享
Private m_blnSelectAll As Boolean = True
Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
If m_blnSelectAll Then
TextBox1.SelectAll()
Else
TextBox1.SelectionLength = 0
End If
m_blnSelectAll = Not m_blnSelectAll
End Sub
Module Module1
Private TextBox1 As TextBox
Public Property _TextBox1() As TextBox
Get
Return TextBox1
End Get
Set(ByVal value As TextBox)
TextBox1 = value
End Set
End Property
Sub MySub()
TextBox1.Text = "123456"
End Sub
End Module
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Module1._TextBox1 = Me.TextBox1
Module1.MySub()
End Sub
End Class