VB.Net Property的实例
乐博网lob.cn提示:调试环境为 vs2005 + windows2003 / windows2008 / xp / vista
Public Class PropertyForm Dim num As String = "属性默认为空" Public Property a() As String Get Return num End Get Set(ByVal ab As String) num = ab End Set End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MessageBox.Show(Me.a) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.a = TextBox1.Text End Sub End Class |