hi @TomasG ,
Yes, you can call the OnSelect property of a button inside a gallery. However, directly invoking the OnSelect event of a button is not possible. Instead, you can place the code that you want to execute in a separate function and call that function from the OnSelect property of the button.
Let's assume you have a gallery named Gallery1 with a button named Button1 inside it.
1.Set a variable in the OnSelect property of the button:
Set(ButtonClicked, true);
2.Use this variable in another part of your app to run the desired code:
For instance, you can use a Timer control to check the variable and execute the code.
- Add a Timer control to your screen.
- Set the Start property of the Timer to ButtonClicked.
- Set the OnTimerEnd property of the Timer to your desired code and then reset the variable.
// Desired code to execute
// Reset the variable after execution
Set(ButtonClicked, false);
​
This approach allows you to execute the code when the button is clicked without directly invoking the OnSelect event. The Timer control acts as a mediator to run your code based on the variable’s value.