16,721
社区成员




Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = 0
Dim SmallValue As Single
SmallValue = TextBox1.Text
End Sub
Public Class Form1
Property RetValue As String
Get
Return TextBox1.Text
End Get
Set(value As String)
TextBox1.Text = value
End Set
End Property
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = "moren"
End Sub
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = 0
Dim SmallValue As Single
SmallValue = TextBox1.Text
End Sub
End Class
'*****外部调用*****
Class Waibu
Dim frm As New Form1
Dim Mystr As String
Public Sub ReadTxt()
Mystr = frm.RetValue
End Sub
End Class
Dim _smallValue As Single ''定义在外面
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = 0
_smallValue = TextBox1.Text
End Sub
Property ReadOnly SmallValue As Single
Get
Return _smallValue
End Get
End Property
Property ReadOnly SmallValue As Single
Get
Return CType(TextBox1.Text, Single)
End Get
End Property