I´m stoped in a simple line of code to get the final result:
I tell:
I´have got a listview which contains datas, which opens list and save list till now no problem, Here is the question:
I´d like that every time I open a file appears the name of the file in a Label or textbox, which is near the listview
that contains the data.
-Example I have charged the file "coco" using Open List, the contents of that file it puts on the listview, BUT Id
like that "coco" appears on a Label or Textbox too !.
I put the code of Open List and Save List.
Please Help me !!!! (LM is the listview)
-----Save List------------------------------------------------------------------------
Private Sub Command1_Click() On Error Resume Next Dim fso As New FileSystemObject ShowSave abc = Module3.filename For i = 1 To LM.ListItems.Count Data = Data + vbNewLine + LM.ListItems(i).Text + "=" + LM.ListItems(i).SubItems(1) Next fso.CreateTextFile(abc, True).Write Data End Sub
------Open List-----------------------------------------------------------------------
Private Sub Command2_Click()
Dim pdat, qdat
On Error Resume Next
Dim fso As New FileSystemObject, Data, dato
ShowOpen
abc = Module3.filename
Data = fso.OpenTextFile(abc, ForReading).ReadAll
dato = Split(Data, vbNewLine)
LM.ListItems.Clear
For i = LBound(dato) To UBound(dato)
If dato(i) <> "" Then
pdat = Mid(dato(i), 1, InStr(1, dato(i), "=") - 1)
qdat = Mid(dato(i), InStr(1, dato(i), "=") + 1)
LM.ListItems.Add(, , pdat).SubItems(1) = qdat
End If
Next
End Sub
Send to <Removed>
This post has been edited by macosxnerd101: 11 March 2013 - 01:18 PM
Reason for edit:: Added code tags and removed email per site policies

New Topic/Question
Reply



MultiQuote





|