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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing background color with a command 1

Status
Not open for further replies.

lvadmin

MIS
May 5, 2004
28
US
Is there a way to change the background color with a command? I can't seem to find any information on this.

Thanks,

Ross
 
Hi Ross,

From the Help on BackColor:

Object.BackColor[ = nColor]

Jim
 
Ross,
Not all controls (in all versions of VFP) have a BackColor property. What are you trying to change and in what version of VFP?

Rick
 
Sorry about that I am using vfp 8 and I simply would just like to alter the backcolor, but without having to go in and select it each time.

I have tried that command above:

Object.BackColor[ = nColor]

but simply says object object is not found.

Unsure of what could be the cause of it...
 
Object.BackColor[ = nColor]

This is a generic statement to show the syntax. You need to fill it in with the name of your object and the color. Example:

form1.backcolor = RGB(192,192,192)

Jim
 

form1.backcolor = RGB(192,192,192)
"object form1 is not found"

?

Thanks,

Ross
 
Hi Ross,

"Form1" is just my example of the name of an object. You need to replace it with the name of your actual object, the one you wish to change the color of.

Maybe you just want to change the BackColor of the screen? Try:

_screen.backcolor = rgb(192,192,192)

Jim
 
Ross,
You must use the "real" object's name - not just "form1". The easiest way to do this inside your Form Load() (for example) is to use the generic - self-referential:
Code:
ThisForm.BackColor = RGB(192,192,192)
Note: IN VFP 8.0, this can be effected by the VFP Theme settings when running under XP / 2003.

Rick


 


lvadmin said:
Is there a way to change the background color with a command? I can't seem to find any information on this.

Faq184-3534



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks, Jim

The following command:
_screen.backcolor = rgb(192,192,192)


worked great!! Thanks everyone...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top