我建了一个class类:
Private name As String
Public Property nm() As String
Get
Return Me.name
End Get
Set(ByVal value As String)
Try
If Me.name = value <= 10 And Me.name = value >= 1 Then
Me.name = value
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Set
End Property
我用下面的语句实现赋值和输出:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim nam As New Class1
nam.nm = 4
MessageBox.Show(nam.nm)
End Sub
我怎么点击按钮的时候什么都不出而且提示我只能再1到10之间呀,怎么解决呀!!!