Daniel,
I can still not reproduce the behaviour you initaly described.
Have you singlesteped through your code to see where (on which line) the problem occurs?
>The value of the Right&Left mouse clicked together is my problem.
Lets see if I understand right.
Your user press both keys Right and Left Key together.
Have you checked the value of nButton in this moment?
Is the value 3 if both keys are released? (you are in MouseUp so according to documentation the question is wich key is
released).
If I see the codes for Button
1 Left
2 right
4 middle
This looks like they are bitcoded, IOW
2^0 Left
2^1 Right
2^2 middle
so I would test to see if the right key is released:
IF !EMPTY(BITAND(Button,2^1))
What else would I test?
If you completely remove the code from MouseUp, does the problem still occur?
Is there any other code in MouseUp, Keypress or related, which value has forms Keypreview?
If Keypreview is .t. is there any code in Forms Keypress?
Is a control bound to ESC, (Property CANCEL is .t.)?
Which value has _VFP.AUTOYIELD?
Try to run the complete stuff with SET ESCAPE OFF. If this helpfull then the ESC will stop the programm. This happens in an ocx so things are not that easy. Try to catch ESC in KeyDown or Keypress.
Agnes
PS Sorry for a littel bit confused. I'm melting in the middays heat.
>
>I use LASTKEY() to find the problem.
>
>IF the value is 27 I lose the function of the menu.
>
>To restore the problem, I need to press the Escape Key twice to get the menu working again. Why and what is happening..I do not understand ?
>
>At this point, I know the using the Lastkey()=27 will trap the problem, but I cannot remove the problem as I cannot change the value of the lastkey()?
>
>Txs
>
>Daniel
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]