No Bug - Ignore

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
  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

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

-Karen

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.

-karen

Can’t duplicate it in a simple project… But as I said my code works on a mac and I have no idea now why it does not work on Windows

Have you tried invalidating it after you set it so it updates on the next UI redraw ?

Yes

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

yeah we dont lock threads
thats a thing on TOF :slight_smile:

can you tell us what it WAS ?

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:

  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.

You COULD change the title to “Not a bug, please ignore”

That’s done. What was the previous title? :grin: