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

White Buttons in VFP 8

Status
Not open for further replies.

jsams

Programmer
Aug 22, 2000
73
US
We have a FPW2.6 application that we recompile in VFP6 and is working just fine. Recompile in VFP7 and everything is OK. Recompiled in VFP8.0 and the buttons are now "white".

Used debug under VFP8 and checked the "colorsource" property and it is 5 which doesn't exist as a property value. Doesn't seem to cause a problem in VF 6 and 7, but sure does in VF 8.

I created a pure Visual form with a button control and found the colorsource = 4 as default in VF 6,7,and 8.

Must be some difference in VFP8 but I haven't found a workaround yet, has anyone else encountered this quirk?

TIA,
John

PS. Rewrite it in Visual is not and option
 
Welcome to VFP8 "themes". Read up on themes, your situation is probably related to themes.

Mike Krausnick
Dublin, California
 
I have checked into that Mike and turned "OFF" the Themes, but it didn't help, BTW running W2K opsys.

John
 
In the designer, select the button and then right-click on each color property in the Property Sheet and select "Reset to Default". If that doesn't fix it, check the class each button is based on and reset there.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Hi

In your start.prg or main.prg.. just before the main form or menu is started.. put the code..

_screen.Themes = .f.

(I am suggesting it agains despite your saying that you set this, because, the themes property has a level and your button may be coming from a higher level). If you disable that at _screen level, it could solve your problem.

:)

ramani :)
(Subramanian.G)
 
Thanks for the replies. Ramani, I doublechecked and I do have the following at the top of my main.prg program before any screen calls are made.

#IF ATC("Visual", VERSION()) > 0
_screen.ColorSource = 4
SET ENGINEBEHAVIOR 70
_screen.Themes = .F.
#ENDIF

John
 
jsams,

You can use the transfrm.app to change the colorsource property of all the buttons in your forms...only takes a moment and works like a charm...change them to 4 or whatever then recompile the application and everything will be fine. Here is a link that will give you some understanding of the transfrm.app that comes with VFP and how to use it to fix your problem.




Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Looks like a fix Sligthaze, if I were converting the 2.6 code, but I am recompiling the screen ".SPR's" in Visual. Thanks for the tip tho, I am sure that it will come in handy in the future.

John
 
I'm not sure I understand...are you saying that you do not have SCX files and the entire application uses only SPR files?

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Slighthaze: Our application is FPW 2.6. We take the .PRG, .SPR, .FRX files and recompile in VFP 6.0 for an EXE. This allows us to utilize some of the new functionality in Visual without a total rewrite, which is not an option for this particular product.

John
 
Ok well then I would go to Google and do a search...

text "search and replace" freeware

...and then I would use one of those programs that you can freely download to search and replace every occurence of the colorsource property that is equal to 5 with something legal. Then compile the program into a an exe.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Did the search, but as I suspected, no COLORSOURCE property statements found, except the _screen.colorsource = 4 that I added to my mainline .PRG. Remember, the code in the .SPR is compiled FoxPro for Windows 2.6.

It would appear the problem is created either when Visual is compiling the 2.6 code into the EXE, or during runtime execution. My guess is that attempts to force the colorsource property is not working is because these are not true visual screens.

It appears some backward compatibility has been lost in version 8, either by design or as the result of "new feature" changes.

John
 
John,
It isn't just 8.0, I got those same errors when converting to 6.0 years ago! MS has never suggested that ALL features would forever be completely backward compatible. Compared to the changes required in upgrading Access applications between versions, VFP hasn't broken much at all!

Rick
 
In case anyone is still interested in this one... Had some programs that were responding in 8 as described (buttons appeared grey in version 6 & 7, white in v 8). But only some of the buttons. Did some checking in the programs and found some inconsistencies in the use of 'Forecolor' and 'Backcolor'. The buttons with problems had .bmp's attached while the ones without problems had .ico's attached. Changed the .bmp button from backcolor = RGB(255,255,255) to forecolor = RGB(255,255,255). Since (255,255,255) is not grey?????

Guess what??? Now they are all gray again. Same as in v 6 & 7.

I tried the _screen.colorsource and _screen.themes settings and they did not seem to make any difference once the backcolor and forecolor were swithched.

WJS
 
Yes, wjs2, I am still interested!! Thanks for the reply and will give it a try this morning.

Thanks again,
John
 
wjs2, Evidently your apps are converted pre-VFP8. My app is not converted, just the FPW 2.6 code (prg, spr, reports & and menus) recompiled. The properties you mention appear only on Visual buttons.

Thanks for the try tho, looked promising.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top