1) I want to select a row with enter key. How Can I? I can do it with double click.
2) I have added a button to sample (thanks to nageswaragunupudi) below. Before than I can use the XBrowse object as a default, but after added the button in order to choice from xbrowse i must select it. I wrote the oBrw:SetFocus() on Dialog ON INIT. It did not change anything. How can i focus the XBrowse when i activate the dialog.
Thanks,
- Code: Select all Expand view
#include 'fivewin.ch'
#include 'xbrowse.ch'
REQUEST DBFCDX
function Main()
local oDlg, oBrw
local oSeek, cSeek := Space(25)
USE CUSTOMER NEW ALIAS CUST SHARED VIA 'DBFCDX'
SET ORDER TO TAG SALARY
GO TOP
DEFINE DIALOG oDlg SIZE 540,480 PIXEL
@ 10, 10 XBROWSE oBrw ;
COLUMNS 'First','Last','Salary' ;
SIZE 250,200 PIXEL ;
OF oDlg ;
ALIAS 'CUST' ;
AUTOSORT
@ 220, 10 SAY oSeek VAR cSeek SIZE 100,10 PIXEL OF oDlg ;
COLOR CLR_BLACK, CLR_YELLOW
@ 220, 210 BUTTON "&OK" PIXEL OF oDlg
oBrw:bSeek := { |cSeek| CUST->( DbSeek( Val( cSeek ), .t. ), !eof() ) }
oBrw:oSeek := oSeek
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED on INIT oBrw:SetFocus()
return nil