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

Menu item run twice when clicked once

Status
Not open for further replies.

jmcfarlane

Programmer
Mar 21, 2001
21
0
0
CA
Hi, I am using VFP6 service pack 5 on windows NT 4 service pack 6a at work and windows 98 at home. The application I am working on occasionally seems to get two clicks on a menu item. I click on the menu item and the routine for that menu item runs twice. I have tried to duplicate this in debug mode but to no success. Does anyone have a suggestion?
 
Bad or dirty mouse? I've been having a bit of trouble with my mouse doing that sort of thing recently. But not on just one program. Still, if you were monitoring mousedown or something, it might react too quick to a stutter.

Another possibility might be some loop in your program which doesn't get reset when it's called the first time. Watch out especially for any public variables which might be used in your routine. This might be especially hard to find if you've got some escapes from your routine which don't clean up properly after themselves. -- Dave
 
After your menu routine has run, try adding the DOEVENTS command. This passes control back to the OS, which should then eat up the errant click before it gets back to your menu. If all your code runs the menu item's procedure (i.e. you're not calling another program or form), you may have to add a "wait [] timeout .05" statement to let the doevents do its thing.
HTH
Dan Dan Walter
DWalter@zoo.uvm.edu
 
I tried this put there was no difference. I increased the wait time from 0.05 to 0.25 but still no change other than an amount of time between when the first window pops up and the second.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top