Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: surinder singh
  Where is surinder singh?
 mumbai
 India
 surinder singh
 To: Ellick Yeung
  Where is Ellick Yeung?
 
 Hong Kong
 Ellick Yeung
 Tags
Subject: RE: Text box fore color in a grid
Thread ID: 189072 Message ID: 189076 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Wednesday, August 13, 2008 10:09:56 AM         
   


> Hi all,
>
> I am wondering if we can set the Forecolor of a specific text box in a grid depanding on its value.
>
> I used the SETALL method to set the back or fore color for the whole column but I don't know how to reference the text box of a column.
>
> Thanks!
>
> Ellick

Do you mean you want to set forecolor/backcolor of single cell and not the whole column/row?

if that is the case then you can change your forecolor in textbox's gotfocus and lostfocus events
grid1.column1.text1.gotFocus  && you can also use WHEN event
IF yourCondition
 this.forecolor = rgb(255,0,0)
endif


grid1.column1.text1.LostFocus
this.forecolor = rgb(255,255,255)

-----------------------------------------------------------------------------------------------
Regards
Surinder Singh
Email: sur200@indiatimes.com
Check my blog for details: http://weblogs.foxite.com/sur200
----------------------------------------------------------------------------------------
*If you understand what you're doing, then you're not learning anything.

ENTIRE THREAD

Text box fore color in a grid Posted by Ellick Yeung @ 8/13/2008 9:52:10 AM
RE: Text box fore color in a grid Posted by Stefan Wuebbe @ 8/13/2008 10:08:26 AM
RE: Text box fore color in a grid Posted by Ellick Yeung @ 8/13/2008 10:55:26 AM
RE: Text box fore color in a grid Posted by surinder singh @ 8/13/2008 11:04:56 AM
RE: Text box fore color in a grid Posted by Stefan Wuebbe @ 8/13/2008 12:17:42 PM
RE: Text box fore color in a grid Posted by Jun Tangunan @ 8/13/2008 1:13:57 PM
RE: Text box fore color in a grid Posted by Ellick Yeung @ 8/14/2008 4:56:36 AM
RE: Text box fore color in a grid Posted by surinder singh @ 8/13/2008 10:09:56 AM
RE: Text box fore color in a grid Posted by Mustapha Bihmouten @ 8/13/2008 10:11:24 AM
RE: Text box fore color in a grid Posted by Jun Tangunan @ 8/13/2008 10:14:53 AM