Hello Guest

Author Topic: Can we have control before a toggle button changes state?  (Read 1873 times)

test84

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Can we have control before a toggle button changes state?
« on: March 01, 2014, 10:12:48 pm »
Hi,

Is there any even that is fired before a toggle contro's IsOn state changes?

What I want is to have some control when player presses a toggle button control but before it actually toggles it, I want to cancel the toggle based on some criteria.

In other words, If you press a toggle button, I want to catch that event, do some checks and if it's valid, let the toggle button change it's state and if the calculations return false, I show an overlay screen and toggle button should not have changed it's state.

Is there like a click or something that toggle button has that help me do that?

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can we have control before a toggle button changes state?
« Reply #1 on: March 02, 2014, 09:12:36 pm »
Nope, but you do have the code to all of this and it isn't exactly complicated. Feel free to customise it :)