I have built an enhanced button control which I want to use to capture the number of times the button has been clicked. I have added the new control to a test program but cannot get it to work. The code for the enhanced control is as follows:
Private Sub EnhBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnhBtn.Click
End Sub
Public Property totclicks() As Integer
Get
Dim n As Integer
totclicks = n + 1
End Get
Set(ByVal Value As Integer)
totclicks = Value
End Set
End Property
End Class
The code for the test program is:
Private Sub EnhButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles EnhButton1.Click
Label2.Text = (EnhButton1.totclicks.ToString)
End Sub
End Class
Thanks in advance for all your help!!