LISTANDO ARQUIVOS NUMA LISTBOX

USUARIO.EXCLUIDOS 02/05/2005 16:50:18
#81321
galera, eh possivel eu definir um diretorio e o aplicativo listar todos os arquivos numa listbox??? (FileListBox nao =D, ListBox msm...)

se tiver como, como eu ffaria isso???

vlws...
GABRIEL.LOGAN 02/05/2005 17:13:08
#81328
Resposta escolhida
Antes de começar eu quero dizer que estou usando um FileListBox mas o resultado vai aparecer no ListBox não no FileListBox pois o FileListBox ficará invisível!

Adicione um List1, File1, Drive1 e um Dir1.

Coloque a propriedade do File1.Visible = false

e coloque o código:

Private Sub Dir1_Change()
List1.Clear
File1.Path = Dir1.Path
For x = 0 To File1.ListCount - 1
File1.ListIndex = x
List1.AddItem File1.FileName
Next
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub Form_Load()
File1.Path = Dir1.Path
For x = 0 To File1.ListCount - 1
File1.ListIndex = x
List1.AddItem File1.FileName
Next
End Sub
USUARIO.EXCLUIDOS 02/05/2005 17:22:42
#81331
opa, blz..... testei aqui e funcionou certinho, brigadao GABRIEL_LOGAN

=)
GABRIEL.LOGAN 02/05/2005 17:39:51
#81335
Se funcionou encerre o tópico fazendo o favor.
Tópico encerrado , respostas não são mais permitidas