count click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • donkeyparfait
    New Member
    • Jan 2007
    • 10

    #16
    Exactly what i was looking for. Thanks dude.


    Originally posted by Lavs
    Halu! :-) Create a project in vb. Add 1 button on the form, also add a textbox.
    The textbox just show you the number of clicked you've done. If the number of clicked is equal to 10, a msgbox will be displayed, and the counter variable A is set back to its initial value which is zero(0).


    Dim a As Integer

    Private Sub Command1_Click( )
    a = a + 1
    Text1.Text = a
    If a = 10 Then
    MsgBox "You click the button " & a & " times"
    a = 0
    Text1.Text = a
    End If
    End Sub

    Private Sub Form_Load()
    a = 0
    End Sub

    Comment

    • hbarger0003
      New Member
      • Sep 2008
      • 1

      #17
      Thanks guys. I am new to this site, but I read some messages in this forum and it helped me complete my assignment. I knew the concepts of counting clicks, I just didn't know how to do it. Thanks! This forum helped a lot!

      Comment

      Working...