Listbox Problems with Selected, CellBackGroundPaint and CellTextPaint

  1. 8 months ago

    Arthur G

    10 Feb 2018 Pre-Release Testers

    I would like not have the first row of this list to be Selected. My listbox is comprised of “should be single character” cells and the window is called Spelling, since that is it’s function. The only cells which are NOT readonly are the ones with appropriate data. Some data is readonly, like ( ) parentheses and , commas. The data for this datum is at this link:
    가늘다' rel='nofollow external' target='_blank' class='link-external'>https://www.dropbox.com/s/ui6u5o34czynv58/%EA%B0%80%EB%8A%98%EB%8B%A4%20File%20Row%20Properties.jpeg?raw=1]가늘다 File Row Properties

    I have tried several techniques, like setting Listbox.ListIndex = -1 , but this doesn’t do it here. As soon as I fill the row with data or click on a cell, the row is selected.
    I have also tried to use CellBackGroundPaint and CellTextPaint.
    This is what it starts off (which is correct).
    가늘다 Spelling Pre GiveUp

    When I call GiveUp or Refresh the data 가늘다 should in the ListBox, but it isn’t. See my other post Listbox Problems with my cell update
    The following is the code. and the code for the event which calls them via Invalidate cell (in a cell Lost Focus event) and then the 2 cell events.

    If me.Cell(row, column) <> RfrshWord(k) Then
      me.CellTag(row, column) = "False"
      me.InvalidateCell(row, column)
    Else
      me.CellTag(row, column) = "True"//It is good or has not changed
    End If
    Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) Handles CellBackgroundPaint as Boolean
      If row < me.ListCount And Me.CellTag(row, column ) = "False" Then
        g.forecolor = CWrngColr
        g.fillrect (0, 0, g.width, g.height)
      Else
        g.ClearRect 0, 0, g.Width, g.Height
        g.ForeColor = &cffffff
        g.FillRect 0,0,g.width,g.height
      End If
      Return True
    End Function
    Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) Handles CellTextPaint as Boolean
      If row < me.ListCount Then
        g.forecolor = &c000000
      End If
      'Return True
    End Function

    This is what happens after I do my code.
    가늘다 Spelling blank Post Give Up
    The only cell which I can see a "¿" is the first one (and it should be a ”가”).

    I am going to start over with the window. It used to work, but now it doesn't.
    Build it as a separate project first, then integrate it.

  2. Axel S

    is not verified 10 Feb 2018 Europe (Germany, Erfurt)

    why you do not insert the images here ?

    click on image, paste your link and we see it here ...

    -image-

    -image-

  3. Arthur G

    10 Feb 2018 Pre-Release Testers

    Argh. I could not get it to work Axel. Thanks.

  4. Emile S

    10 Feb 2018 Europe (France, Strasbourg)

    @Arthur G I have tried several techniques, like setting Listbox.ListIndex = -1 , but this doesn’t do it here. As soon as I fill the row with data or click on a cell, the row is selected.

    Standard working.

    You can use: Listbox.ListIndex = -1 after filling a Row to remove the focus to any Row.
    You can also use ClearFocus after filling a Row to remove the focus to the Listbox.

    I think you have to focus your attention to rule out one drawback, then another, then an… etc.

    Also, what happens (in term of colors) when you move the selected Row from Row 0 to some Rows after the one(s) that have a Color change ?

  5. Tim H

    10 Feb 2018 Pre-Release Testers Portland, OR USA

    InvalidateCell might be affecting more than just the one cell. You might want to keep a CurrentRow and CurrentColumn property that you can use in CellxxxPaint to affect only the one cell you care about.

  6. Arthur G

    11 Feb 2018 Pre-Release Testers Answer
    Edited 8 months ago

    I am going to start over with the window. It used to work, but now it doesn't.
    Build it as a separate project first, then integrate it.

  7. Julia T

    11 Feb 2018 Sandy Hook, Connecticut

    Why is Return True commented out in CellTextPaint?

or Sign Up to reply!