SegmentedControl on Windows bug?

This is with 2019r1.1 on either Win7 or 10.

I have listbox where each item can have one of 3 states (or none for the first item in the list).

I have segmented control below it set to SelectionState Single.

In the listbox change event I set the section value for segment representing the state of that item to true.

On the Mac it works as expected when the listbox selected row changes…

On Windows however, the selected he SegmentedControl does not change to reflect the state of the listbox row that is selected.

Anybody else see this? If it’s bug is there a workaround?

Is it something I am doing?

My code in the listbox change event is: ( MaskingSC is the SegmentedControl)

Dim row as Integer = me.ListIndex 
If row = -1 then Return

if Row = 0 then 
  MaskingSC.Enabled = False
  For i as Integer = MaskingSC.Items.UBound DownTo 0 
    MaskingSC.Items(i).Selected = false
  MaskingSC.Enabled = true
End if

' This is the data in the listbox row
Dim Level As MicroPlate.Kinetic.Velocity.Level = MicroPlate.Kinetic.Velocity.Level(Sample.Dilutions(me.RowTag(row).IntegerValue))

Select Case Level.Usage
Case MicroPlate.UsageTypes.Never
  MaskingSC.Items(0).Selected = true
Case MicroPlate.UsageTypes.Always
  MaskingSC.Items(1).Selected = true
Case MicroPlate.UsageTypes.IfPasses
  MaskingSC.Items(2).Selected = true
End Select

I tried compiling the same code in 2020R1 and I get the same behavior on Windows as with 2019 r1.1


I found it updates from the listbox but only AFTER I make a manual selection with the segmentedControl…

On windows it seems something needs to be initialized when enabled, but is not.


Tried setting all selected to false then setting only the one button you want select to true?

If I remember correctly, SegmentedControl is a custom control on Windows. Have you tried calling invalidate as the very last instruction?

If I remember correctly, SegmentedControl is a custom control on Windows. Have you tried calling invalidate as the very last instruction?

Yes I did and I also tried setting all the segments…

But I can’t duplicate the issue in a simple project in 2019r1.1 or 2020r1 … But as I said my code works on a Mac and I have no idea now why it does not work on Windows!


I was just being stupid… It is working on Windows… Please lock this thread

What was wrong then ?

The items in the listbox were not in the states I expected because of how I was displaying them. They can have one of 3 settings.

A) Never use the value regardless
B) Always use the value regardless
C) Use the value if it passes specs

So 3 setting but that can result in 4 possible states:

  1. Never Use the value
  2. Always use the value
  3. Use value If passes spec and data passes.
  4. Use value If passes spec and data DOES NOT pass

Right now visually 1 & 4 look the same
As does 2& 3 (I need to change that in a way that is intuitive!)

I was using different data sets to test on Mac and Windows. (first mistake!)

On Windows all the items had setting C but some were in state 4 … but I thought, because of the visual cues, those were supposed to be set to A…

When going through the listbox I expected the segment selected (which represents settings A,B, C) to change to A on that row… But it never changed because they were all set to C!

So confusion on my part.