Perdón que no conteste pero a pesar que funciono ok, el problema que tengo es que cuando borro el opanel y vuelvo a cargarlo el primer boton queda deshabilitado o sea no puedo hacer click, si en el resto.
function BorroControl( oPanel, nItem )
local nTop, nLeft, nLen := len( oPanel:aControls ), n
if nItem <= nlen
for n := nLen to nItem + 1 STEP - 1
oPanel:aControls[ n ]:nTop := oPanel:aControls[ n -1 ]:nTop
oPanel:aControls[ n ]:nLeft := oPanel:aControls[ n - 1 ]:nLeft
next
oPanel:aControls[ nItem ]:End()
HB_ADel( oPanel:aControls, nItem, .t. )
endif
oPanel:SetRange()
oPanel:Refresh()
return .t.
function muestroD( wdepto )
for i = 1 to len( todepto )
BorroControl( oPanel, 1 )
next i
todepto := { }
tofdepto := { }
tocdepto := { }
oculto()
for i = 1 to len( obtnw )
oBtnw[ i ] := .t.
oBtng[ i ] := ""
next i
sele stock
set order to 5
go top
seek strzero( wdepto, 2 )
i = 0
nCol := 20
nRow := 20
do while ! eof() .or. depto <> wdepto
wcarga := .t.
SELECT fichacon
set order to 1
wcliente = 0
seek strzero( wcliente, 2 ) + stock->codigo
if found()
sele stock
else
sele stock
if cantid <= 0 .and. file( "lrc" )
if VeoGuarni( codigo )
else
wcarga := .f.
endif
sele stock
else
endif
endif
Code: Select all | Expand
sele stock
if wcarga
aadd( todepto , "" )
aadd( tofdepto, "" )
aadd( tocdepto, "" )
i = len( todepto )
todepto[ i ] = iif ( empty( descri1 ), alltrim( descri ), alltrim( descri1 ) )
tofdepto[ i ] = foto
tocdepto[ i ] = codigo
jcod := tocdepto[ i ]
@ nRow, nCol BTNBMP PROMPT todepto[ i ] ;
FILE tofdepto[ i ] action cargocod( alltrim( str( &jcod ) ) ) round NOBORDER ;
SIZE 120, 120 PIXEL OF oPanel FONT oFontj // 2007
if nCol > 200
nRow += 140
nCol := 20
else
nCol += 140
endif
endif
set order to 5
skip
if depto <> wdepto
exit
endif
enddo
oPanel:SetRange()
oPanel:refresh()
retu .t.
que estoy haciendo mal?
Saludos
Jorge