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!

Command buttons disappear

Status
Not open for further replies.

aiden

Programmer
Apr 23, 2001
27
CA
Hi,
I have a VFP 6.0 application with several command buttons that is used to launch other VFP 6.0 applications. On some of the PC's in my company, when the user launches the secondary applications, the buttons and graphics on the main application disappear. If you click where you think a button is, it shows up again. Otherwise, all the user sees is a grey form. I've tried different colour settings and properties for my main form but no luck. Here's the strange thing, we use the same model of laptop and desktop throughout my company but this happens to only about 5-10% of my users.

Any suggestions?
Thanks in advance.
 
Hi,
While the secondary applications were originally 2.6, they were totally rewritten in VFP 6.0. The application that is used to launch these programs is an original VFP 6.0 application - and this is the one whose buttons are disappearing.

Thanks.
 
I had a similar problem tonight and just solved it. First I looked around here, then set out to see what would work. For everyone's benefit I'm listing the links and suggestions, but my solution is at the bottom. (What a way to spend an evening.)

See thread184-841977 which gives some suggestions, such as disabling Themes support[/]u. Another idea to investigate is the Hot Tracking / Hover feature. Similar issues was reported in thread184-683467 and thread184-459145 but no fixes reported there. If a grid is involved then thread184-365875 and thread184-365788 suggest entering your code in the DataEnvironment's BeforeOpenTables Method rather than Init, or set Column Sparse to .F.

I have a VFP 9.0 application that does the same thing with my XP sp2 computer and it is not a straight port from anywhere. A port, yes, on portions of the processing code but totally rewritten for the interface and reports.

It does not happen until at least one pass has been made. If I move my mouse (MouseEnter) over my Exit button, cmdExit, nothing happens until I move away (MouseLeave) and then it disappears. Any time I move my mouse over it, it reappears, but only while the mose is there. It still works, though not much of a consolation. Once I had it to wipe out everything on my form except for the controls within within Shape classes. Hmm, another clue.

As respects an idea in thread184-420618, I don't think it ever encountered an unexpected QUIT.

Some reports said video driver or inadequate video cards could be the culprit, but I doubt it in my case with a new computer. Is it partially an OS issue? It worked fine on Windows 98, Windows Millennium and Windows 20000 Professional, but my new fully updated XP sp2 had the above disappearing controls issue with the same VFP 9.0 application compiled as a COM EXE. Since XP has Themes, I decided to research that first.

VFP 9.0 Help says this:
Themes said:
Note:
When Themes are enabled, you should avoid using the CLEAR command for forms because it might cause paint issues with themed controls, such as command buttons, that have mouse hovering effects.

You can set _SCREEN.Themes property to False (.F.) to disable Themes entirely in Visual FoxPro.

Note:
When you set _SCREEN.Themes property, you do not actually alter the current state of Themes set at the operating system level. You should use SYS(2700) - Enables Windows XP Themes to check the current state of Themes.
So, what worked for me? I searched my forms and found one CLEAR command. As noted above, it is not appropriate for a form, so I removed it, and my problem is gone! Yipee!

I think your users with the disappearing buttons all had Windows XP, right? Ah ha! Now you know why we always tell all who post here to include a wide range of background details, including the OS version of the troublesome computers, as in this case it does matter and might have helped someone else to answer your plea for help much sooner! So I suggest you search your projects for any left over CLEAR commands in your forms, remove them all and test it again. Let us know if it helps.

dbMark [spin] I [spin2] am [spineyes] happy! [wiggle]
 
The .Themes setting does not apply in VFP6, it was introduced in VFP8.

Rob.
 
An update: I was working on another project which also had that pesky CLEAR statement in a command button's code. It hadn't been noticed before because there was a shape control beside it and only a small part, the button's bottom that extended below the shape's level, was disappearing.

Again, get rid of that CLEAR statement in any form code unless you know you need it somehow.
 
>>>Again, get rid of that CLEAR statement in any form code unless you know you need it somehow. <<<

What possibly could the reason be for having clear in a form anyway?
 
Crewchiefpro6, I agree. It was just left over from old converted code. I would never have thought that one command would be such a pain. I made my posts here and documented all the issues and solutions details so I could be as helpful as possible for others who get stumped with this problem in the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top