Yes, so you can add a header in the middle of your expanding row:
And that’s what these blanks are. They are created using AddRowAt.
Yes, and they do not highlight because the have no text as windows SOP is to only highlight the text on expandable rows, which they are, even though they don’t show a +, unless you add your own PaintCellBackground event to override that, deja vu, one hour later.
This doesn’t work right. Keeps highlighted every blank row and not releasing.
if cellName= " " then
g.ForeColor = color.HighlightColor
g.FillRect(0,0, Me.Width, me.Height)
end
You need
if cellName = " " and me.RowSelectedAt(Row) then
...
Now we’re getting somewhere. Still some oddities. I moved the starting position over a bit, so that the highlight starts where the other rows do. What’s weird is, it stretches out to the end, but there is the white space eventually…a break in the highlighted row. If I highlight two rows, they both do this. Changing the “1000” integer here only varies the stretch and space in the line.
Also, swiping up to highlight multiple rows skips over these blank rows still.
if cellName = "" and me.RowSelectedAt(Row) then
g.ForeColor = color.HighlightColor
g.FillRect(17,0, 1000, me.Height)
end
Seems like a bizarre workaround for something that didn’t need to be there in the first place. I can think of no logical reason why Expandable Rows don’t highlight the same way are regular rows.
It really would help if you provided an example that illustrates not just snippets of code, but also the listbox properties.
The project is huge…would be time consuming to strip it down to something small.
Wouldn’t be just a matter of create a new project, put a listbox on the window, add some rows and demonstrate the issue? Also, is your listbox multi-column? Be sure to duplicate that as well.
Don’t strip your huge project, create a new one with only the Listbox and enough code to replicate your problem.
OK, so I found the culprit for the white gap in the highlighted row when the window was expanded… I added this to make the horizontal scrollbar show up when the window isn’t maximized.
SCRIPT_LISTBOX.ColumnWidths = "1700"
If I take it out, the gap and repetition of the highlighted section doesn’t show up. (see the pic I posted earlier)
1st question. How do I keep the horizontal scroll bar when the window is smaller and still not have this glitch?
2nd question. I still can’t highlight the blank row when clicking on a regular row and dragging my mouse/swiping more rows up or down. I can easily replicate that in a small project if anyone wants me to upload that.
Anything over
SCRIPT_LISTBOX.ColumnWidths = "17"
gives me gaps of some kind.
So this seems to be the magic combination for fixing the white gap.
This in Window opening:
SCRIPT_LISTBOX.ColumnWidths = "2400"
And this in PaintCellBackground
if cellName = "" and me.RowSelectedAt(Row) then
g.ForeColor = color.HighlightColor
g.FillRect(17,0, me.Width, me.Height)
SCRIPT_LISTBOX.refreshcell(-1,-1)
end
No if anyone has any ideas on why the blank spaces aren’t getting highlighted when swiping multiple rows (see pic above), I’m all ears. The example I put will demonstrate that too, but it was before the gap fix I’m posting here, so that part is still broken in the example project.
So I decided to use having my blank rows contain spaces. This solves both problems, and no cell painting is needed.
A quick piece of code lets me easily change the number of spaces without having to hit the space bar hundreds of times.
dim SPACEPASS as Integer
dim LONGSPACE as String
SPACEPASS = 0
LONGSPACE= " "
while SPACEPASS < 200
LONGSPACE = LONGSPACE.Replace(" ", " ")
SPACEPASS = SPACEPASS + 1
Wend
Thanks everyone for the help. I still think this is unnecessary and that Expandable Row Listboxs should function the same as non-Expandable Row Listboxs when it comes to highlighting.
this ask for id/pass