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

Backcolor for Page on page frame 3

Status
Not open for further replies.

FoxEgg

Programmer
Mar 24, 2002
749
AU
VFP8

I set the backcolor for a page on a page frame (code put in a click event of a command button)

thisform.pageframe1.page2.BackColor = 165280
thisform.Refresh()

but no matter what I write .. what color I set... I cannot seem to change the back color

Do I need to set another property first ???
Any clues ???


JF
 
I don't know why yours isn't working, but mine works if I use RGB() instead of a regular number:

Code:
** make my background color red
thisform.pageframe1.page2.BackColor = rgb(255,0,0)
thisform.Refresh()

Is it possible that you have some contrary code in your refresh() method?



Regards

Griff
Keep [Smile]ing
 
Well I don't get it Griff.. but I tried your code and it worked

I then re tried with the color picker... and it worked again

Bloody Hell Mate


I will need to try again tomorrow in the morning at work.... but whatever RGB does it worked...

I will advise

JF
 
Magic fairy dust!

Do you have any thoughts on my doevents thing?

(Perhaps you have some magic dust of your own?)

B-)

Regards

Griff
Keep [Smile]ing
 
I will read all about do events... another hole (black hole) in my knowledge.

JF
 
FoxEgg,
There is a problem with the PageFrame refreash, I Can not remember when they fixed it Version 8 or 9. But the Pages of a page frame do not refreash with a Thisform.Refreash() call. The Pages had to be called individually to refreash.

In the Refreash of the page frame place this code someplace,

.....
FOR i = 1 TO THIS.PageCount
THIS.Pages.Refresh()
ENDFOR
.....

That will make each page refreash then the Main Page does. Not needed in Version 9.


David W. Grewe (Dave)
 
I don't think you need this code. Why do you have to refresh each page and not the active page only? Though I believe we recently discussed this, I just forgot where.

Anyway, for pages to change their color you have to set Themes off.

Also there is a great blog by Cesar Chalom at
 
I don't know if this is relevant, but keep in mind that a page frame's BackColor is only visible if the page's Themes is .F.

There are also some issues with the transparency of a page - you can't change the BackStyle when the page frame's Tabs is .T.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
OK.. now here is something that has knocked my socks off...

What I did was went home and used XP Remote Desktop to hook up to work (both machines are running XPPro)...

The REMOTE VIEW of the WORK Machine demonstrated proper behaviour (That is I could make the page of the pageframe change colour with either bit of code above).

Now I am back at work .. sitting at the actual work machine and the Page Frame colour will not change with either bit of code... or with a SYS(2700) command.

So does this mean it is an XP thing ???

I have tried _SCREEN.Themes = .T.

and checked that MESSAGEBOX(SYS(2700)) returns 1

and the command SYS(2700,1)

So Pageframe backcolor works when I look with Remote Desktop but doesn't work when am sitting amy workstation...

Any help appreciated

JF
 
Thanks White-ster and Mike

It would have been nice if I read Mike Lewis' post a bit more closely.... As I wrote I wrote

_screen.Themes = .T.

Oh Doh !!!!

Once it was written clearly I got the message... it worked with

_screen.Themes = .F.


Thanks to All (I think problem solved)

FoxEgg



 
Yes Sorry Ilyad.. You did...

It looks like I didn't appreciate the tips when they were give... my VFP ignorance...

Thanks to you all for the input....

Just a thought in passing...

If I understand it correctly that this is a XP Pro 'THING'... Can I ask, is there a switch somewhere in XP Pro that I can set to avoid the need for the _screen.Themes = .F.

My home computer VFP backcolor thing works without setting themes...

JF
 
I have just ran
Code:
run>services.msc

and there is a 'Themes' section which I can stop..

Interestingly it is Running 'on ' on both computers... yet the performance on my work computer needs the _screen.Themes=.F. to make it work properly.

Mmmmm

JF
 
You can't control whether your users are using Windows XP themes or older appearance schemes. What _Screen.Themes controls is what happens in VFP, which is all you should try for.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top