Antonio
Con mis buenos deseos para ti y para la gente del foro
Antonio Por favor como hago una busqueda incremental dese un listbox?
De antemano Gracias
Cordialmente
Jairo Barbosa
Busqueda incremental
- leandro
- Posts: 1720
- Joined: Wed Oct 26, 2005 2:49 pm
- Location: Colombia
- Has thanked: 15 times
- Been thanked: 3 times
- Contact:
jejejejejej
Que pena la demora.... pero aqui esta el codigo de una de las formas como lo hago yo...
Code: Select all | Expand
DEFINE DIALOG oDem11 RESOURCE "oDemu11" OF oWinp
REDEFINE BTNBMP oBsali ID 73 OF oDem11 FILENAME (oLamcla:iSali) NOBORDER ACTION oDem11:end()
REDEFINE GET oT1og1 VAR oT1vg1 ID 115 OF oDem11 ON CHANGE ( ::Assign(),;
IF(tCon->(DbSeek(AnsiToOem(Upper(SubStr(oT1vg1,1,::nPos-1))+;
Upper(Chr(nKey))))),(oT1oli:UpStable(),oT1oli:Refresh(),.t.),((""),.f.)))
SELE tConc
REDEFINE LISTBOX oT1oli VAR oT1vli;
FIELDS tConc->ACformat,tConc->ACconcep,tConc->ACnombre;
FIELDSIZES 50,50,150;
ID 110 OF oDem11;
HEADERS "Formato","Concepto","Nombre";
ON CHANGE pRefCon();
ON LEFT DBLCLICK (Grabar:="ModCon",pModCon())
oT1oli:nclrpane:=oLamcla:cComb
oT1oli:bKeyDown:={|nKey|iif(nKey==13,(Grabar:="ModCon",pModCon()),(" "))}
oDem11:cTitle := "Catálogo Conceptos"
ACTIVATE DIALOG oDem11
Mas tarde público la otra manera de hacerlo
Saludos
LEANDRO ALFONSO
Bogotá (Colombia)
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com
[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 24.09 ] [ xHarbour 64 bits) ]
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com
[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 24.09 ] [ xHarbour 64 bits) ]
Re: jejejejejej
leandro wrote::oops:
Que pena la demora.... pero aqui esta el codigo de una de las formas como lo hago yo...Code: Select all | Expand
DEFINE DIALOG oDem11 RESOURCE "oDemu11" OF oWinp
REDEFINE BTNBMP oBsali ID 73 OF oDem11 FILENAME (oLamcla:iSali) NOBORDER ACTION oDem11:end()
REDEFINE GET oT1og1 VAR oT1vg1 ID 115 OF oDem11 ON CHANGE ( ::Assign(),;
IF(tCon->(DbSeek(AnsiToOem(Upper(SubStr(oT1vg1,1,::nPos-1))+;
Upper(Chr(nKey))))),(oT1oli:UpStable(),oT1oli:Refresh(),.t.),((""),.f.)))
SELE tConc
REDEFINE LISTBOX oT1oli VAR oT1vli;
FIELDS tConc->ACformat,tConc->ACconcep,tConc->ACnombre;
FIELDSIZES 50,50,150;
ID 110 OF oDem11;
HEADERS "Formato","Concepto","Nombre";
ON CHANGE pRefCon();
ON LEFT DBLCLICK (Grabar:="ModCon",pModCon())
oT1oli:nclrpane:=oLamcla:cComb
oT1oli:bKeyDown:={|nKey|iif(nKey==13,(Grabar:="ModCon",pModCon()),(" "))}
oDem11:cTitle := "Catálogo Conceptos"
ACTIVATE DIALOG oDem11
Mas tarde público la otra manera de hacerlo
Saludos
LEANDRO ALFONSO
Bogotá (Colombia)
/**************************************************
Leandro
Muy agradecido por tu respueta la estare probando, y pena me da a mi quitarte tiempo cuando se que tienes poco.
Cordialmente
Jairo Barbosa
- Antonio Linares
- Site Admin
- Posts: 42404
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 12 times
- Been thanked: 48 times
- Contact:
Aqui tienes un ejemplo:
Code: Select all | Expand
#include "FiveWin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),;
oSay:Refresh() }
@ 14, 2 SAY "Searching:" SIZE 60, 30
@ 14, 12 SAY oSay PROMPT cSearch SIZE 80, 30
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function Search( nKey, cSearch )
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
endif
Customer->( DbSeek( cSearch, .t. ) )
return nil
//----------------------------------------------------------------------------//
Antonio Linares wrote:Aqui tienes un ejemplo:Code: Select all | Expand
#include "FiveWin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),;
oSay:Refresh() }
@ 14, 2 SAY "Searching:" SIZE 60, 30
@ 14, 12 SAY oSay PROMPT cSearch SIZE 80, 30
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function Search( nKey, cSearch )
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
endif
Customer->( DbSeek( cSearch, .t. ) )
return nil
//----------------------------------------------------------------------------//
Antonio
Expreso mi agradecimiento a ti y a Leandro por su colaboracion
Funciona Ok
Cordialmente
Jairo Barbosa