Unofficial Nextion/TJC User Forum

How to show/hide controls on active page from arduino code? [SOLVED]

Hello,
I have the following challenge. I need to manipulate the controls on a page from my arduino code: hide some controls, show other controls, enable/disable timer. The way I do it is via global page variable, which value I set in my code and then read on page Preinitialize event and do something like this:
vis txtLight,0
tm0.en=1
This works fine when the page just loads, but there is no way to do anything when page is already loaded.
I use ESP32 with Nextion library and control screen elements in object oriented way as outlined in examples. Only Page object has method Show. Regular controls don’t have a way to show/hide or disable.
Any other way to accomplish what I need?

Thanks,
Michael

I figured it out. Use sendCommand();


This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).