From Xojo Documentation
| This item was deprecated in version 2019r2.
Please use SegmentedButton.SegmentAt as a replacement.
The array of segments in the SegmentedControl. The array is zero-based.
Use this property to change the properties of each Segment in the SegmentedControl.
When checking the number of segments you must use syntax like:
will not compile.
This code loops through all the segments and changes their Titles:
For position As Integer = 0 To SegmentedControl1.Items.Ubound
segment = SegmentedControl1.Items(position)
segment.Title = Str(position)
This code adds a new segment and then resizes all the segments so that they are visible:
seg.Title = "Seg " + Str(SegmentedControl1.Items.Ubound + 1)
// Resize all the segments
For i As Integer = 0 To SegmentedControl1.Items.Ubound
Dim item As SegmentedControlItem = SegmentedControl1.Items(i)
item.Width = SegmentedControl1.Width / (SegmentedControl1.Items.Ubound + 1) - 2