New topic: Change color in Listbox text?
<http://forums.realsoftware.com/viewtopic.php?t=29253> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message Jonathon Post subject: Change color in Listbox text?Posted: Mon Jul 27, 2009 1:21 pm Joined: Fri Sep 30, 2005 5:54 pm Posts: 1778 Location: Great Falls, Montana USA I had this thinking it would work but as usual it don't! Main.TagReserved.Action: Boolean Code:If me.value then TagNumber.text = "1" else TagNumber.text = "0" end TranlsationModule.SaveTranslation: Code:... rec.Column("TranslationLongNumber") = Main.TagNumber.Text .. TranslationModule.ViewMainTranslation: Code:// Add Line Items if rs <> nil and rs.RecordCount > 0 then while not rs.eof i = Val(rs.Field("TranslationLongNumber").StringValue) If i = 1 then Main.TxtColor = RGB(255,0,0) else Main.TxtColor = RGB(0,0,0) end ... Main.TransList.CellTextPaint: Code:// Make Cells Normal g.Bold = False g.ForeColor = TxtColor Return False Dim TxtColor as Color Something is not right so can some one point me int he right direction? Thanks! ps.. If you are wondering why such a crazy ordeal, I just didn't want to blow the DB again and enter in some 280 translations again! _________________ Jonathon Software Devlopement: http://www.medalertpc.com Surplus Hardware: http://www.semielectronics.com RB2005 R4 Pro for Windows XP Pro/SP2 Top timhare Post subject: Re: Change color in Listbox text?Posted: Mon Jul 27, 2009 1:27 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 5932 Location: Portland, OR USA CellTextPaint is called for each cell. If you use a single variable in the window to indicate the color, all the cells will get that color. I think what you want is for just certain cells to get that color. If so, you need to store the color indication in the listbox row, along with the data to be colored. Tim Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- 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]
