New topic: 

Listbox background color change dynamic

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

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        vfran          Post subject: Listbox background color change 
dynamicPosted: Sat Mar 19, 2011 9:44 am                         
Joined: Mon Dec 07, 2009 7:30 pm
Posts: 49                I have a checkbox that I want to use to control the 
background color of a listbox.
Eg. If checked: white. If unchecked: yellow.
What is the best way to do this?   
                             Top                 DaveS          Post subject: 
Re: Listbox background color change dynamicPosted: Sat Mar 19, 2011 10:28 am    
                             
Joined: Sun Aug 05, 2007 10:46 am
Posts: 2868
Location: San Diego, CA                use the state of the checkbox to 
determine what color to use in the listbox DRAWBACKGROUND event      
_________________
Dave Sisemore
MacPro, OSX 10.6.4 RB2009r5.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                Jym          Post subject: Re: 
Listbox background color change dynamicPosted: Sat Mar 19, 2011 4:05 pm         
                
Joined: Sat Oct 01, 2005 5:19 pm
Posts: 2304                Subclass the listbox and add the property bgColour 
As Color then have your checkbox change the value of bgColour is another 
technique, but you still need to use the cellbackground event.  The difference 
is you can now easily use other controls to control the state. Or reuse the 
listbox somewhere else.  

g.forecolor = bgColour

//set bgColour or it will paint black when it opens   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 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]

Reply via email to