Sorry but I'm not following you.
>I need to stop the loop after it has been clicked.
>
>
>>Why not use KeyPress event ?
>>
>>>I’m using this code in a click method of a form and trying to get escape but the ? shows the same values regardless of what I press. I have the KeyPreview = .t.
>>>
>>>DO WHILE 1 = 1
>>>
>>> IF ctr > 50
>>> EXIT
>>> ENDIF
>>>
>>> ?INKEY(), LASTKEY(), CHRSAW()
>>>
>>> IF INKEY() = 27
>>> EXIT
>>> ENDIF
>>>ENDDO
>>>
>>>
>>>but my ? only shows 0 13 .f. regardless of what key I press
--sb--