I have a Listbox and in the CellBackgroundPaint event, I have placed the following code to add a Folder icon if the row contains a Folder or a File icon if the row contains a File.
It loads fine but when I scroll down it throws an error
if column = 0 then
if instr(Listbox1.Cell(row,3), "Folder") > 0 then
Dim Myicon As Picture ' get a reference to the picture you want
' draw it flush on the right side of the cell
g.DrawPicture(folderico, 5, 0)
elseif instr(Listbox1.Cell(row,3), "Folder") = 0 then
Dim Myicon As Picture ' get a reference to the picture you want
' draw it flush on the right side of the cell
g.DrawPicture(fileico, 5, 0)
end if
end if
If I scroll all the way to the bottom, the program stops and throws an error. Same if I change the directory.