G
Guest
I have data that I need to either put in a spreadsheet, or use in a listview to view it. I would rather use the listview but I don't understand how to put my data into it. Here is the code I have, currently I am just display all the data in a label and it sucks.
Private Sub btnGetDoubles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesbtnGetDoubles.Click
Dim colors(9) As String
Dim duoColorCollection As New Collection
Dim nameList As String = ""
Dim oneInst As Class1
Dim intCounter As Integer
Dim i As Integer
Dim j As Integer
colors(0) = "Red"
colors(1) = "Green"
colors(2) = "Blue"
colors(3) = "Purple"
colors(4) = "White"
colors(5) = "Yellow"
colors(6) = "Brown"
colors(7) = "Orange"
colors(8) = "Black"
colors(9) = "Maroon"
Dim inst As New Class1
For i = 0 To colors.Length - 2
For j = i + 1 To colors.Length - 1
duoColorCollection.Add(colors(i) + "-" + colors(j))
inst.InstanceName = colors(i) + "-" + colors(j)
Next j
Next i
For Each inst.InstanceName In duoColorCollection ' Create list of names.
nameList &= inst.InstanceName & ControlChars.CrLf
Next
' Display the list of names in a label.
lblDoubles.Text = nameList
End Sub
Private Sub btnGetDoubles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesbtnGetDoubles.Click
Dim colors(9) As String
Dim duoColorCollection As New Collection
Dim nameList As String = ""
Dim oneInst As Class1
Dim intCounter As Integer
Dim i As Integer
Dim j As Integer
colors(0) = "Red"
colors(1) = "Green"
colors(2) = "Blue"
colors(3) = "Purple"
colors(4) = "White"
colors(5) = "Yellow"
colors(6) = "Brown"
colors(7) = "Orange"
colors(8) = "Black"
colors(9) = "Maroon"
Dim inst As New Class1
For i = 0 To colors.Length - 2
For j = i + 1 To colors.Length - 1
duoColorCollection.Add(colors(i) + "-" + colors(j))
inst.InstanceName = colors(i) + "-" + colors(j)
Next j
Next i
For Each inst.InstanceName In duoColorCollection ' Create list of names.
nameList &= inst.InstanceName & ControlChars.CrLf
Next
' Display the list of names in a label.
lblDoubles.Text = nameList
End Sub