get cOpc1 valid setLista()
get lbLISTA
LISTBOX {"teste1","teste2,"teste3","teste4"} when empty(cOpc1)
//até ai td bem.
// Esta função abaixo é para apagar o conteúdo do listbox caso o campo cOpc seja preenchido.
function setLista
if ! empty(cOpc1)
lbLISTA = space(06)
endif
return .t.
acontece q quando altero o conteúdo de cOpc1 para vazio, a listbox não fica em branco...
Editado pela última vez por JoséQuintas em 06 Ago 2020 22:16, em um total de 1 vez.
Razão:Mensagem editada para colocar a tag [ code ]<br>Veja como utilizar esta tag: http://www.pctoledo.com.br/forum/faq.php?mode=bbcode#f2r1
LOCAL oCIDADE;
, nI;
DO WHILE .T.
FOR nI = Len( aMunicipios ) TO 1 STEP -1
hb_ADel( aMunicipios, nI, .T. )
NEXT
IF Len(aMunicipios) <= 0
EXIT
ENDIF
ENDDO
FOR EACH oCIDADE IN SEFAZ_CIDADE
IF oCIDADE[1] == mUF
AAdd(aMunicipios,oCIDADE[3])
ENDIF
NEXT
RETURN NIL
Editado pela última vez por JoséQuintas em 06 Ago 2020 22:17, em um total de 2 vezes.
Razão:Mensagem editada para colocar a tag [ code ]<br>Veja como utilizar esta tag: http://www.pctoledo.com.br/forum/faq.php?mode=bbcode#f2r1
LOCAL cOpc1, aOpcList := {}
@ 1, 0 get cOpc1 VALID SetLista( cOpc1, @aList )
@ 2, 0 get aList LISTBOX aOpcList when empty( cOpc1 )
function setLista( cOpc1, aList )
if empty( cOpc1 )
aList := {"teste1","teste2,"teste3","teste4"}
else
aList := {}
endif
return .t.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
PROCEDURE Main
LOCAL cOpc1 := Space(3), x := Space(1), GetList := {}
SetMode( 30, 100 )
CLS
@ 1, 0 GET cOpc1 VALID Check( @cOpc1 )
@ 3, 0 GET x
READ
RETURN
FUNCTION Check( cOpc1 )
LOCAL nTest := 1, GetList := {}
LOCAL aList := { "teste1","teste2","teste3","teste4" }
IF ! Empty( cOpc1 )
RETURN .T.
ENDIF
SAVE SCREEN
@ 2, 0, 8, 10 GET nTest LISTBOX aList
READ
RESTORE SCREEN
RETURN .T.
Muita atenção ao LOCAL GetList := {}
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
Fernando queiroz escreveu:Tem esta opção tambem
hwg_Sendmessage( ThisNFE:oCombo4:handle, CB_RESETCONTENT, 0, 0 )
Acho que confundiu.
O Listbox em questão é da GETSYS, console.
O que mostrou é do combox, componente do Windows (apesar do comando parecer da hwgui, é a troca de mensagens do Windows)
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/