How can I switch on/off button effects using a function?

Thank you. I will follow your advice. Outstanding!!!