Button with 2 actions

Hi i use BC++ and i want to use button to handle two actions
like first click do action 1
second click do action 2 and so
LVL 2
altra22Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BrianGEFF719Connect With a Mentor Commented:
just use a static int:

static int numClicked = 0;
numClicked++;

switch (numClicked)
{
 case 1:
   //do something
   break;
 case 2:
   //do something else
   break;
 default:
   //more than 2 clicks....
}
0
 
loki982Commented:
an easy way to go about this would be to connect the button to an intermediate slot where you could increment a member variable
from there you could create some logic on that member variable to determine what functions to call from there
0
 
altra22Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.