Setting MobileSegmentedButton Selection

Is it possible to set the selected button programmatically for a MobileSegmentedButton? The code below runs without error in Xojo 2025 2.1 but nothing happens.

Var s As MobileSegmentedButton

s = optSettings

s.SegmentAt(2).Selected = True

optSettings.refresh

Never fails. I struggle with something for a couple of hours, finally post a questions, then almost immediately figure it out. The line below will set index i as the selected button.

optSettings.SelectedSegmentIndex = i

1 Like