enhanced button control that counts clicks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lab3terch
    New Member
    • Oct 2006
    • 22

    enhanced button control that counts clicks

    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(By Val sender As System.Object, ByVal e As System.EventArg s) 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_Clic k(ByVal sender As Object, ByVal e As System.EventArg s) Handles EnhButton1.Clic k
    Label2.Text = (EnhButton1.tot clicks.ToString )
    End Sub
    End Class

    Thanks in advance for all your help!!

    --------------------------------------------------------------------------------
Working...