|
-
Jun 7th, 2006, 11:30 AM
#1
Thread Starter
Hyperactive Member
ListView and URL to SubItem ?
Hello,
I use below code for my api and here is sample of text what I load and what I need next.
My listview are CheckBoxes!
This is List.txt
======================================================
My File1:v.1.0:Great SW:http://www.something.com/get something1.zip
My File2:v.1.0:Great SW:http://www.something.com/get something2.zip
My File3:v.1.0:Great SW:http://www.something.com/get something3.zip
My File4:v.1.0:Great SW:http://www.something.com/get something4.zip
======================================================
I dont want to load URL link in listview
When I select for example 2 checkboxes and press commadn2
to be able download thouse 2 file, 1 afther another
Any help are welcome
VB Code:
Private Sub Command1_Click()
On Error GoTo listviewERROR
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear
Dim itmX As ListItem ' Create a variable to add ListItem objects.
Dim clmX As ColumnHeader ' Create an object variable for the ColumnHeader object.
Dim ff As Integer
Dim strParts() As String
Dim strLine As String
ff = FreeFile
' Add ColumnHeaders.
Set clmX = ListView1.ColumnHeaders.Add(, , "File", ListView1.Width / 2.5)
Set clmX = ListView1.ColumnHeaders.Add(, , "Version", ListView1.Width / 2.5)
Set clmX = ListView1.ColumnHeaders.Add(, , "About", ListView1.Width / 0.5)
ListView1.BorderStyle = ccFixedSingle ' Set BorderStyle property.
ListView1.View = lvwReport ' Set View property to Report.
Open "C:\List.txt" For Input As ff
Do Until EOF(ff)
Line Input #ff, strLine
strParts = Split(strLine, ":")
' Add a main item
Set itmX = ListView1.ListItems.Add(, , RTrim(strParts(0)))
' Add a subitem for that item
itmX.SubItems(1) = strParts(1)
itmX.SubItems(2) = strParts(2)
Loop
Close ff
Exit Sub
listviewERROR:
List1.Clear
List1.AddItem "Error number 14001!" ' File are modified
Exit Sub
End Sub
-
Jun 7th, 2006, 12:28 PM
#2
Re: ListView and URL to SubItem ?
To be able to download without rereading the textfile, then you need to store the URL somewhere. Try the Tag property if you don't want to show thr URl to the user.
VB Code:
Do Until EOF(ff)
Line Input #ff, strLine
strParts = Split(strLine, ":")
' Add a main item
Set itmX = ListView1.ListItems.Add(, , RTrim(strParts(0)))
itmX.Tag = strParts(3)
' Add a subitem for that item
itmX.SubItems(1) = strParts(1)
itmX.SubItems(2) = strParts(2)
Loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|