Segment.Width

From Xojo Documentation

Property (As Integer )
aSegment.Width = newIntegerValue
or
IntegerValue = aSegment.Width

New in 2019r2

Supported for all project types and targets.

The Width of the segment. The default is that all the segments are evenly wide.

Example

This example increases the width if the segmented is selected. Notice that it calls ResizeSegmentsToFit after it has finished testing all the segments.

// count down so we avoid re-evaluating the ubound all the time
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 so we want to increase this segment in size
s.Width = s.Width + 2
End If
Next

// make sure the segmented control knows to resizes its drawing boundaries or you can get weird effects
SegmentedButton1.ResizeSegmentsToFit