LISTBOX KEYDOWN

LISTBOX KEYDOWN

Postby gss200610 » Mon Nov 21, 2011 3:33 pm

hello everyone, I wonder if anyone here had problems with the esc key to exit from a listbox
because I have a listbox with the resource and the User must press the esc key to close dialog
follows the code of the dialog below:
I've tried various ways without success until now. if someone can help thank you.

DEFINE DIALOG oDlgSItef RESOURCE "OPERACOES_SITEF_ADM" TITLE "Funções Administrativas" BRUSH oBrushSitef TRANSPARENT

REDEFINE GROUP ID 200 OF oDlgSitef
REDEFINE LISTBOX oLbxLista VAR cItem ITEMS aLista ID 110 OF oDlgSitef UPDATE

REDEFINE BTNBMP oButtom1 ID 111 OF oDlgSitef FONT oFnt ;
RESOURCE "Confirm24" ;
PROMPT "&Continua" ;
TOOLTIP "Continua o processamento" ;
ACTION ( cContinuaNavega:="000001" ,;
cEscolha:=LEFT( cItem, 1 )+ ":" ,;
oDlgSitef:End() ) ;
LEFT 2007

REDEFINE BTNBMP oButtom2 ID 112 OF oDlgSitef FONT oFnt ;
RESOURCE "Cancelar24" ;
PROMPT "&Cancelar" ;
TOOLTIP "Cancelar o processamento" ;
ACTION ( cContinuaNavega:="-00001" ,;
lContinua:=.F. ,;
oDlgSitef:End() ) ;
LEFT 2007

oLbxLista:nDlgCode := DLGC_WANTALLKEYS

oLbxLista:bKeyDown := { | nKey, nFlags | IF (nKey==VK_RETURN, oButtom1:Click(), ),;
IF (nKey==VK_ESCAPE, oButtom2:Click(), ) }

oDlgSItef:bKeyDown:={|nKey| IF (nKey==VK_RETURN, oButtom1:Click(), ),;
IF (nKey==VK_ESCAPE, oButtom2:Click(), ) }

oDlgSitef:SetColor(CLR_RED,RGB(219,224,242))
// oSay1:SetColor(RGB(255,255,255),RGB(248,139,36))
oLbxLista:SetColor(RGB(0,0,0),RGB(242,244,255))
// oSay1:SetFont(oSayFnt1)
oLbxLista:SetFont(oFntLista)
oLbxLista:SetItems(aLista)

oDlgSitef:bStart:={|| oLbxLista:SetFocus() }
ACTIVATE DIALOG oDlgSitef CENTERED


resource:
OPERACOES_SITEF_ADM DIALOG 281, 43, 310, 302
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Escolha uma Operação"
FONT 8, "MS Sans Serif"
{
GROUPBOX "", 200, 6, 5, 299, 257, BS_GROUPBOX
LISTBOX 110, 11, 12, 290, 247, LBS_NOTIFY | WS_BORDER | WS_BORDER | WS_VSCROLL
PUSHBUTTON "&Confirmar", 111, 160, 272, 69, 22
PUSHBUTTON "&Cancelar", 112, 235, 272, 70, 22
}
gss200610
 
Posts: 36
Joined: Sat Jun 19, 2010 10:09 am
Location: Goiania - Goias - Brasil

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 118 guests