New topic: 

text color in a listbox

<http://forums.realsoftware.com/viewtopic.php?t=29366>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       galois           Post subject: text color in a listboxPosted: Mon 
Aug 03, 2009 12:58 pm                        
Joined: Wed Jun 21, 2006 3:11 pm
Posts: 69              I have a listbox with three column two of which are 
invisible.  I use the second and third columns to track various conditions.  I 
am trying to write an element of a listbox in a certain color based on a 
condition.  I thought this was going to be easy but I can't seem to make it 
work.

Here is the code in  CellTextPaint for listbox2.

  Dim i, n As Integer
  n = ListBox2.ListCount - 1
  For i = 0 to n
  If listbox2.cell( i, 1 ) = "e" Then
  g.ForeColor = RGB( 255, 0, 0)
  Else
  g.ForeColor = RGB( 0, 0, 0 )
  End if
  Next

This puts all of the listbox in red which I think is occurring because the last 
element in this particular listbox is true for the IF condition.

Any suggestion appreciated.   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to