> I have two listboxes and have populated each with data. Now what I want is > to be able to run through each listbox one row at a time and compare them > side by side. If one has a row which doesn't match the other, I want to > insert a new row in the listbox which doesn't contain the data, and > highlight the new row's text in red (this is so the discrepancy is added, > then highlighted, so the comparison going forward will still be testing for > a match). Then just keep going down until done.
It's not clear to me how you are going to figure out, if there is a mismatch on row N, whether it's listbox A or listbox B that needs to have a row added. Is the user expected to input this? When you figure that out, the Listbox.CellTextPaint event can be used to color the text. Just set g.ForeColor to red and then return false, indicating to the system that it should continue to process the event (thus drawing the text in the normal way, only with a red color). You'll need to store information somehow so that CellTextPaint can decide whether to alter the color or not. There are many ways to do this; it's just a question of whether you'd rather store this data within the listbox, or within a subclass of it, or within the window that contains the listbox, or somewhere else. One way is to use Listbox.CellTag to store, say, the color that the text should be painted (or some higher-level data that allows CellTextPaint to figure out the color). If the tag for a cell is Nil, CellTextPaint can do nothing, but if it is not Nil, then CellTextPaint can investigate further. > Also, these are rows populated with data about files on a volume. I'd like > to be able to add the full path to each item in the cell next to the > filename. To get the path, use FolderItem.Absolute path. To assign it to a cell, use Listbox.Cell(row, column). _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
