Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running code after a resize
Message
From
27/02/2002 04:12:37
 
 
To
26/02/2002 11:59:21
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00625168
Message ID:
00625608
Views:
10
This message has been marked as the solution to the initial question of the thread.
Hi!

After some experimenting I did figured out that the timer event, event after the timer is disabled, continue to fire! It looks like VFP cached the timer events during the form resizing internal processes, then fire the timer event as many times as needed for the passed period of time. To fix this behaviour, just use following very simple thing:

* Timer event
IF !MDOWN() AND this.Enabled

this.Enabled = .F.
MESSAGEBOX("HI")

ENDIF


Now message box appears only once.

>This is great. I'm getting really close now.
>One more small problem, though.
>
>I have code similar to this in the timer:
>
>IF !MDOWN() THEN
> THISFORM.Timer1.Enabled = .F.
> MESSAGEBOX("HI")
>ENDIF
>
>And the timer is enabled on the resize. Works great in most situations.
>
>But, when i resize the form and hold it in the same position for 4-5 seconds before releasing the button on the mouse at that same position (at which point the timer will hit) it actually runs my code (and displays my messagebox) multiple times. The longer I hold the mouse before letting go the more times.
>
>I'm not sure exactly why this is happening or how to get around it.
>Any suggestions.
>Oh, and thank you very much for the help so far
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform