On Mar 03, 2007, at 15:45 UTC, Luis Cordova wrote: > when you said separately do you mean that i can do the button call in > the way: > > listbox1.CellBackgroundPaint ...
No, you call Listbox1.InvalidateCell, as has been pointed out to you at least twice now. This causes the CellBackgroundPaint and CellTextPaint events to fire. When the content of a cell changes, invalidate it, and that's it, problem solved. > i am having a hard time explaining over and over what im trying to do. No, I think you've explained it fine. You're just not following our suggestions. > 1-i start with all balls on a column painted black Seems like you have this... > 2- clicking button updates a vector corresponding to each cell in a > column that supposedly changes the colors from black to other colors > independently for each cell, i.e. some will be changed to yellow, > some will be changed to red. So, change your vector, then call InvalidateCell on each cell, or the entire column. > 3- clicking a button again keeps updating the vector...and so on Same as answer 2. > the solution you proposed works as long as i have hard coded what > color or color variable i have for each cell. if i declare lots of > color variables, one per cell, and for each cell i assign it to the > cell then it may work, however, it may not be the best solution. Well what did you mean by "vector"? I assumed you meant an array (just as you seem to use "table" to mean ListBox). A vector of colors would work fine. Even better, perhaps, would be to store the color you want directly in the listbox data, using the CellTag(row,column) property. > Is there a function to code this dynamic change of color from outside? Yes, you change wherever you're storing these colors or whatever indicates what colors should be drawn, and then call InvalidateCell. Did I mention you should call InvalidateCell? Best, - Joe P.S. Please remember to call InvalidateCell. :) -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
