Acess dynamic created buttons after its creation

Hello,
Im building a menu with checkbox buttons. All of those buttons are dynamically created inside a horizontal box. I have another button , outside that horizontal box, that was created manually. And I want that button to control if some elements of the horizontal box is checked or not. Is it possible? Basically I want to control those buttons from other button. Can someone give me an advice on this?
thanks in advance

You’ve described this:

But somehow I feel that’s not what you’re after. You can keep the created buttons checkboxes in an array to avoid casting if that’s important.

That worked fine for me! Thanks!!