From Xojo Documentation
True if the segment is selected.
SegmentedButton1.SegmentAt(i).Selected = False
SegmentedButton1.SegmentAt(0).Selected = True
You access the segments of a SegmentedButton from the control’s SegmentedButton.SegmentAt method. It requires a parameter that specifies the segment that you want to address. In this example, the following code selects all the segments in a loop. For each segment, it uses the Selected property to determine whether the segment is selected.
For i As Integer = SegmentedButton1.LastSegmentIndex DownTo 0
// get the reference to the segment
Var s As Segment = SegmentedButton1.SegmentAt(i)
// see if the segment was selected
If s.Selected Then
// it is selected so increase this segment in size
s.Width = s.Width + 2
// make sure the segmented button knows to resizes its drawing boundaries or you can get weird effects