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
Next
Return
Else
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
The items in the listbox were not in the states I expected because of how I was displaying them. They could 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:
Never Use the value
Always use the value
Use value If passes spec and data passes.
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!