Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read-only text box colors

Status
Not open for further replies.

amwprogg

Programmer
Jul 8, 2005
52
GB
Hi all.
I have a text box which has the current score (a changing
number) in it. I want it to be READ ONLY or DISABLED - but depending on the score I want the backcolor to change.
?
 

Basically, you need to change the DisabledBackColor and DisabledForeColor properties. You could do this in the text box's Refresh event:

Code:
IF THIS.Value < Whatever
  THIS.DisabledBackColor = 255
  THIS.DisabledForeColor = 0
ELSE
  THIS.DisabledBackColor = RGB(128,128,128)
  THIS.DisabledForColor = RGB(255,255,255)
ENDIF

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top