Jump to content
Fivewin Brasil

ENTER EM LISTBOX (RESOLVIDO)


oziel

Recommended Posts

Caros colegas.

Tenho uma função abaixo que após a pesquisa, pega os dados e retorna.

O que eu queria é saber se há uma forma de que após a seleção no banco de dados, eu apertar a tecla ENTER e ele

selecionar os dados.

Na forma atual quando damos um click (DBCLK) no cliente selecionado ou acionamos o botão volta,

ele faz essa ação, através da Function PesqCli3().

Abraços

//-------------------------------------------------------------------------------------------------------------------------------------


FUNCTION PesqCli2(cPNomec,cCodc,cNomeC,cEres,cRBair,cCity,cCPF,cRFone,nLCred,cTipoDoc,oDlg)

LOCAL oDlg2, oLbx2 // Objetos Caixa de Dialogo
LOCAL oFnt, oG120

// Abrir Base Dados ---------------------------------------------------

Select CADCLI
Set Index to CADCLI
Set Order to 1
DbGoTop()

CADCLI->(DBSEEK(ALLTRIM(cPNomec)))

If ! Found()
MsgStop(OemToAnsi("Cliente nao Cadastrado: " , " Mensagem "))
Return .F.
Endif

// Caixa de Dialogo ---------------------------------------------------

DEFINE FONT oFnt NAME "Arial" SIZE 0, -10

oNome = Space(20)

DEFINE DIALOG oDlg2 RESOURCE "BROWSEDUPCLI" TITLE "SICEW - CORE - Cadastro de Clientes."

REDEFINE LISTBOX oLbx2 FIELDS CADCLI->CODC , ;
SUBST(CADCLI->NOME,1,30) , ;
CADCLI->RFONE , ;
CADCLI->ERES , ;
CADCLI->RBAIR , ;
CADCLI->CITY ;
HEADERS "Codigo","Cliente","Telefone","End. ","Bairro","Cidade";
FIELDSIZES 48, 220, 60, 70, 70, 60 ;
COLOR CLR_BLACK, CLR_MENTA2 ;
FONT oFnt ;
ID 101 ;
OF oDlg2 ;
ON DBLCLICK(PegaCli3(@cPNomec,@cCodc,@cNomeC,@cEres,@cRBair,@cCity,@cCPF,@cRfone,@nLCred,@cTipoDoc),oLbx2:Refresh(), oDlg2:End())

REDEFINE BTNBMP RESOURCE "BTNVOLTA" ID 109 OF oDlg2 ;
ACTION( PegaCli3(@cPNomec,@cCodc,@cNomeC,@cEres,@cRBair,@cCity,@cCPF,@cRfone,@nLCred,@cTipoDoc),,oLbx2:Refresh(),oDlg2:End() );
TOOLTIP OemToAnsi( "Voltar ao Menu Principal" ) ;
NOBORDER


ACTIVATE DIALOG oDlg2 CENTERED
RELEASE oFnt
RETURN .T.

//------------------------------------------------------------------------

Function PegaCli3(cPNomec,cCodc,cNomeC,cEres,cRBair,cCity,cCPF,cRfone,nLCred,cTipoDoc,oDlg)

SysRefresh()

cCodc := CadCli->Codc
cNomeC := CadCli->Nome
cEres := CadCli->ERes
cRBair := CadCli->RBair
cCity := CadCli->City
cCPF := CadCli->CPF
cRfone := CadCli->RFone
nSaldt := CadCli->Saldt
cTipoDoc := Cadcli->TipoDoc
nLCred := Cadcli->LCred - Cadcli->Saldt

CadCli->(DbsetOrder(1))

Return .F.

//-------------------------------------------------------------------------

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...