Comparing row between two listbox


I am trying to compare rows between two listbox, while I do compiling, the app has no error.
its showing Out of Bound exception while I am do dragging the listbox scrollbar, but if i move it by using navigate key on keyboard, its running normal without error

I put the code in celltextpaint event,

If Listbox1.cell(row,3)=Listbox2.cell(row,0) then
  if column=3 then g.foreColor=&cFF0000
end if

any help ?


Why are-you comparing Column 3 (from one ListBox) to Column 0 (the other ListBox) ?

OutOfBounds error means you tried to access a non existant Row or Column.

Also, why do you put this code in CellTextPaint ?

Paint man, not Test nor Check; Paint. These lines are not Paint related. Therefore, how many times a second this Event is Fired when you need to Compare only once.

IMHO, of course.

thanks for the info.
will use the others option to do it


A Button ?
A MenuItem ?

With a window to set the Compare start / end Row|Column ?

you could store the precomputed color in .CellTagAt
and the paint just use it.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.