Questo topic e' stato chiuso dal moderatore.
19/12/08 15:11
MrPaky
Ciao a tutti,
ho bisogno di un piccolo aiuto. Allora vorrei sapere come fare a salvare un icona su un file di testo cioè praticamente ho una listview ke tramite un form e un combobox aggiunge un' icona che si trova nella risorsa incorporata. Esempio:
Codice:
ListView.Items.Add("Ciao", 0)
io vorrei salvare quello 0(zero) nel file di testo
io ho fatto così:
Codice:
Dim enumerator As IEnumerator
Dim stringa As String = ""
Try
enumerator = Me.ListView1.Items.GetEnumerator
Do While enumerator.MoveNext
Dim current As ListViewItem = enumerator.Current, ListViewItem
stringa = (stringa + Conversion.Str(current.SubItems.Item(0).Tag) + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(0).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(1).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(2).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(3).Text + ChrW(13) + ChrW(10))
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator, IDisposable).Dispose()
End If
Però mi da un errore "Number null"
Per favore mi date un aiutino?? grazie anticipatamente
PS allego anche il programma
ho bisogno di un piccolo aiuto. Allora vorrei sapere come fare a salvare un icona su un file di testo cioè praticamente ho una listview ke tramite un form e un combobox aggiunge un' icona che si trova nella risorsa incorporata. Esempio:
Codice:
ListView.Items.Add("Ciao", 0)
io vorrei salvare quello 0(zero) nel file di testo
io ho fatto così:
Codice:
Dim enumerator As IEnumerator
Dim stringa As String = ""
Try
enumerator = Me.ListView1.Items.GetEnumerator
Do While enumerator.MoveNext
Dim current As ListViewItem = enumerator.Current, ListViewItem
stringa = (stringa + Conversion.Str(current.SubItems.Item(0).Tag) + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(0).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(1).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(2).Text + ChrW(13) + ChrW(10))
stringa = (stringa + current.SubItems.Item(3).Text + ChrW(13) + ChrW(10))
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator, IDisposable).Dispose()
End If
Però mi da un errore "Number null"
Per favore mi date un aiutino?? grazie anticipatamente
PS allego anche il programma
aaa