Dear Antonio, James, Uwe and friends!!
How, after pressed ESC, I can set the last key pressed to another, or simply, cancel your execution?
LOCAL cGET1 := SPACE(10)
LOCAL cGET2 := SPACE(10)
LOCAL oDlg
LOCAL cNiv := 0
DEFINE DIALOG oDlg NAME "DLGBOX" OF oWnd
REDEFINE GET cGET1 ID 101 OF oDlg PICTURE "XXXXXXXXXX"
REDEFINE GET cGET2 ID 102 OF oDlg PICTURE "XXXXXXXXXX"
REDEFINE BUTTON ID 901 OF oDlg ACTION (cNiv:=9,oDlg:End()) // = OK-button
REDEFINE BUTTON ID 902 OF oDlg ACTION (cNiv:=0,oDlg:End()) // = Cancel-button
ACTIVATE DIALOG oDlg CENTERED
IF LastKey() = VK_ESCAPE ; cNiv := 0 ; ENDIF
IF cNiv = 9 .OR. (cNiv = 0 .AND. MsgYesNo("The data have been changed. Do you want the data to be save anyway ?")
// Here the data are saved.
ENDIF
if GetKeyState(VK_ESCAPE)
<Esc was pressed, do something>
else
<Esc wasn't pressed, do something else>).
endif
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 111 guests