Dear Experts
On form1 I have pagefrmae1. On keypress event of Form1 I have following codes
If lastkey()=27 and thisform.pageframe1.visible=.t.
thisform.pageframe1.visible=.f.
endif
If lastkey()=27 and thisform.pageframe1.visible=.f.
release thisform
endif
In first condition, if I press ESC while thisform.pageframe1.visible=.t.
then form releases instead of thisform.pageframe1.visible=.f.
I want when I press ESC key it check the visibility of pageframe1.
If pageframe1 is visible then pageframe1 must be visible=.f.
Otherwise Form1 should release.
Please help