We help IT Professionals succeed at work.

Button with 2 actions

altra22
altra22 asked
on
Medium Priority
225 Views
Last Modified: 2010-04-01
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
Comment
Watch Question

Commented:
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
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....
}

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.