FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour HELP!
Posts: 12
Joined: Tue May 06, 2008 10:26 AM
THANKS
Posted: Wed May 14, 2008 10:37 PM

Thanks James.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
HELP!
Posted: Wed May 14, 2008 10:45 PM

David,

>(2) for DbChoice, to select a customer, HOW to activate an enter key instead of click on OK button for selection?

We need to see your code for dbchoice().

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 12
Joined: Tue May 06, 2008 10:26 AM
HELP!
Posted: Wed May 14, 2008 11:53 PM

Here is the source code for DbChoice()

function DbChoice( cTitle, cSelect )

local oDlg, oBrw

DEFINE DIALOG oDlg RESOURCE "DbChoice" TITLE cTitle

REDEFINE LISTBOX oBrw ;
FIELDS ArCust->Code, ArCust->Name ;
HEADERS "Code", "Name" ;
ID 100 OF oDlg

ACTIVATE DIALOG oDlg CENTERED

return nil

Thanks.

Posts: 12
Joined: Tue May 06, 2008 10:26 AM
WORKS!
Posted: Thu May 15, 2008 12:12 AM

Hi DUTCH, it WORKS,
(1) i added in exactly what u told and compile, sorry for not notice the complilation error...

REDEFINE GET oGetCode VAR cCode ID 110 OF oDlg Picture "@!" ;
VALID (if(empty(cCode),.F.,(SelectCode( oGetCode,
cCode ),.T.))

missing one ")" at the end.

Thanks.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
HELP!
Posted: Thu May 15, 2008 08:46 AM
David,

Try this:
function DbChoice( cTitle, cSelect ) 

local oDlg, oBrw 

DEFINE DIALOG oDlg RESOURCE "DbChoice" TITLE cTitle 

REDEFINE LISTBOX oBrw ; 
FIELDS ArCust->Code, ArCust->Name ; 
HEADERS "Code", "Name" ; 
ID 100 OF oDlg 

oBrw:bKeyDown = { | nKey | If( nKey == VK_RETURN, oDlg:End(),) }

ACTIVATE DIALOG oDlg CENTERED 

return nil

Now when you press enter, the DbChoice() dialog should close automatically
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 12
Joined: Tue May 06, 2008 10:26 AM
OK
Posted: Thu May 15, 2008 01:40 PM

"Now when you press enter, the DbChoice() dialog should close automatically" ... Antonio

Ok, Thanks.

Continue the discussion