I have another problem.
I'm using the list view to show data from a file.
It splits it up into columns and cell etc etc
A Strange thing happens when i clear the listview and then reload the data into it (a refresh options). It's for a game by the way.
The following happens.. say this is my table here
("" is the next cell, i didn't want to post a pic too long)
Snail "" 5/0 "" 4 "" 6 "" 00001
Slime "" 6/7 "" 3 "" 7 "" 00002
Something Else "" 1/2 "" 6 "" 7 "" 0003
I use the same code to reload the listview from the file, i just use the ListView.Clear function before reloading the data.
Slime "" "" "" ""
Something Else "" "" "" ""
Snail "" 1/2 "" 6 "" 7 "" 0003
They load in what looks like reverse, but only the bottom stats for the monster shows up and its not even for the monster (the names rearrange).
If you want a screen shot, i can provide it
Here's the code:
VB Code:
Private Sub Form_Load() LstMonster.ListItems.Clear Load_Monsters LstMonster End Sub 'The Loading sub Public Sub Load_Monsters(List_ As ListView) List_.ListItems.Clear DoEvents Dim Monsters_() As String Dim MStats_() As String Dim SText As String Dim I As Integer SText = "" I = 0 Open "MonsterList.txt" For Input As #1 SText = Input(LOF(1), #1) Close #1 Monsters_ = Split(SText, "|MSplit|") List_.SortKey = Left(Monsters_(0), 2) For I = 1 To UBound(Monsters_) Mstats = Split(Monsters_(I), "|LSplit|") List_.ListItems.Add , , Mstats(0) List_.ListItems.Item(I).SubItems(1) = Trim(Mstats(1)) List_.ListItems.Item(I).SubItems(2) = Trim(Mstats(2)) List_.ListItems.Item(I).SubItems(3) = Trim(Mstats(3)) List_.ListItems.Item(I).SubItems(4) = Trim(Mstats(4)) List_.ListItems.Item(I).SubItems(5) = Trim(Left(Mstats(5), 5)) Next I List_.Sorted = True End Sub 'Here's the refresh code that i use (just reload because the clear is in the load code) Private Sub Refresh_Click() Load_Monsters LstMonster end sub




Reply With Quote