ListBox row does not fully visually select

  1. 6 months ago

    Ed K

    Nov 29 Kansas City

    I have a Listbox with several columns. Clicking on any of the cells for a line does trigger the Change() event; however only the cell in the first column shows as selected, not the entire row. Programmatically selecting the line (aListBox.listIndex = n) also has the same effect.

    This problem occurs in 2017r2.1 for WIndows, but NOT for Mac -- where the entire line gets properly visually selected.

    Any suggestions?

  2. Greg O

    Nov 29 Xojo Inc

    Do you have any code in the CellBackgroundPaint event?

  3. Ed K

    Nov 29 Kansas City
    Edited 6 months ago

    Yep. Sure do:

    // Highlight alternating rows
    If (Row Mod 2 = 0) Then
      G.ForeColor = AltRowBackgroundHighlight
      G.FillRect(0, 0, G.Width, G.Height)
    End If

    Presumably I can check and manually paint all cells in a selected row with the selection background color in this loop... And then figure out how to get the text in those cells painted in white?

    Why does this differ for Mac vs Win however?

  4. Greg O

    Nov 29 Xojo Inc

    If you read the docs, you’ll see that the selection may have already drawn. I suggest that your code first say:

    if me.Selected(row) then
       Return Fslse
    End if
  5. Ed K

    Nov 30 Kansas City

    I tried that, with both "me" and "self", but no difference. I can't find any other references to AltRowBackgroundHighlight color in the code. Still strange it works ok as is on Mac version.

    ANy other suggestions?

  6. Greg O

    Nov 30 Xojo Inc

    try to reproduce it in a simple project. if you can, make the sample available for us to look at.

or Sign Up to reply!