On the following code I can't find the problem that xBrowse shows all database fields instead of the ones that I defined:
- Code: Select all Expand view
- DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-14
DEFINE DIALOG oDlg SIZE 637,600 PIXEL ;
TITLE "Sample Records" ;
FONT oFont
@ 10,10 XBROWSE oBrw ;
SIZE 300,230 PIXEL ;
OF oDlg ;
ALIAS "Sample" ;
AUTOCOLS AUTOSORT LINES CELL
@ 250,10 SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 280,10 PIXEL OF oDlg ;
COLOR CLR_BLACK, CLR_YELLOW
SETKEY(VK_RETURN, {|| cPlan := Field_1, oDlg:end()})
SETKEY(ASC("Y"), {|| IIF(GetKeyState(VK_CONTROL), EVAL({|| oBrw:cseek := ;
"", oBrw:oSeek:refresh()}), NIL)})
oBrw:nMarqueeStyle := 5
oCol := oBrw:AddCol()
oCol:cHeader := " Header 1"
oCol:bStrData := {|| Name}
oCol:bLClickHeader := {|| ORDSETFOCUS("Order1"), EVAL({|| oBrw:cseek := "", ;
oBrw:oSeek:refresh()}), oBrw:refresh()}
oCol:Adjust()
oCol := oBrw:AddCol()
oCol:cHeader := " Name"
oCol:bStrData := {|| Name}
oCol:nHeadStrAlign := NCENTER
oCol:bLClickHeader := {|| ORDSETFOCUS("Name"), EVAL({|| oBrw:cseek := "", ;
oBrw:oSeek:refresh()}), oBrw:refresh()}
oBrw:aCols[2] :bClrStd := {|| {CLR_WHITE, IIF(FILE(ALLTRIM(Dfile) + TABLE_EXT), ;
CLR_HBLUE, CLR_HRED )}}
oCol:Adjust()
oCol := oBrw:AddCol()
oCol:cHeader := " Supplier No. "
oCol:bStrData := {|| Sup_no}
oCol:nHeadStrAlign := NCENTER
oCol:Adjust()
oBrw:bClrSel := {|| {CLR_CYAN, CLR_GREEN}}
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED ON PAINT oBrw:setfocus()
RELEASE FONT oFont