As an example, on the OnVisible of my screen, I'm collecting the English alphabet into a collection, setting varSelectedItem to 1, and then performing a CountRows() on the collection. Then my gallery has this in the items:
Index(
colAlphabet,
varSelectedItem
)
The "Next" button:
UpdateContext({varSelectedItem:varSelectedItem+1})
The "Previous" button:
UpdateContext({varSelectedItem:varSelectedItem-1})
The DisplayMode of the next button:
If(
varSelectedItem = varItemCount,
DisplayMode.Disabled,
DisplayMode.Edit
)
And the same on the previous button:
If(
varSelectedItem = 1,
DisplayMode.Disabled,
DisplayMode.Edit
)
