Multi Function Buttons

How do make a button with the title command8 put the following values into text1.text depending on the number of clicks

number of clicks    values
1                     a
2                     b
3                     c
4                     1
Warsteiner99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

autCommented:
Here's the code you need:

Private Sub Command8_Click()
    Static ClickCount As Long
   
    ClickCount = ClickCount + 1
   
    Select Case ClickCount
        Case 1
            Text1.Text = "a"
        Case 2
            Text1.Text = "b"
        Case 3
            Text1.Text = "c"
        Case 4
            Text1.Text = "1"
    End Select
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VbmasterCommented:
You mean something like this?

Sub Command8_Click()

  Static Counter As Integer
  Counter = Count + 1

  Text1.Text = Choose(Counter, "a", "b", "c", 1)

End Sub
0
VbmasterCommented:
Oops, the third line should be

  Counter = Counter + 1
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.