Página 1 de 1

Botoes OK e CANCEL - associados a ENTER e ESC

Enviado: 30 Set 2008 09:05
por Mário Isa
Nesta função:
//----------------------------------------------------------------//

function MsgSelect( aItems, cValue, cTitle )

local oDlg

DEFAULT cTitle := "Selecionar"

DEFINE DIALOG oDlg FROM 5,10 TO 24, 75 TITLE cTitle

DEFINE FONT oFont NAME "Courier New" SIZE 0, -13

@ 1, 2 LISTBOX cValue ITEMS aItems SIZE 185, 95 OF oDlg

@ 10, 6 BUTTON "&OK" OF oDlg SIZE 40, 12 ;
ACTION oDlg:End() DEFAULT

@ 10, 14 BUTTON "&Cancel" OF oDlg SIZE 40, 12 ;
ACTION ( cValue := nil, oDlg:End() )

ACTIVATE DIALOG oDlg CENTERED

if empty(cvalue)
cvalue := '@#$%@#$%@#%@$%@#$%@'
end

return cValue
Como fazer para que, ao pressionar a tecla ESC ganhe o mesmo efeito do o botão Cancel?

Mário

Re: Botoes OK e CANCEL - associados a ENTER e ESC

Enviado: 30 Set 2008 09:24
por gvc
@ 10, 14 BUTTON "&Cancel" OF oDlg SIZE 40, 12 ACTION ( cValue := nil, oDlg:End() ) cancel