Save a list box with the open dialog

AdnanCool12 Messages postés 1 Date d'inscription samedi 2 février 2008 Statut Membre Dernière intervention 15 mars 2008 - 15 mars 2008 à 11:53
cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 - 15 mars 2008 à 14:28
Bonjour chui newbie comme one dis,
je voudrais savoir si quelqu'un pourrais me filer un code pour enregistrer le contenu de ma ListBox dans un .text file avec le Open dialog. & Merci

1 réponse

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
15 mars 2008 à 14:28
Salut,

Voilà :

Private Sub Command1_Click()


    Dim iFreeFile As Integer
        iFreeFile = FreeFile
       
    Dim iIndexListBox As Integer
     
    Open "C:\Listbox.Txt" For Output As #iFreeFile
          
          For iIndexListBox = 0 To List1.ListCount - 1
              Print #iFreeFile, List1.List(iIndexListBox)
          Next iIndexListBox
       
    Close #iFreeFile


End Sub

A toi maintenant de trouver avec la CommonDialog


A+
Exploreur

 Linux a un noyau, Windows un pépin

Un jeu en flash sympa...? Voir ici
Si vous voulez vous inscrire
mettez comme parrain : exploreur
0
Rejoignez-nous