Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42277

Columns in Listview disappear when debugging

$
0
0
Hi guys,
I have a ListView that displays files from a folder.
I have added 3 columns, File, Name and date.
The Listview is populated through a for each loop. When I'm in debugging mode/runing the program, and I press the bottom to populate the ListView, the only colum that remains is the "File" the other ones disapear for some reason.

here is the code:

vb script Code:
    Dim di As New IO.DirectoryInfo(path)         Dim diar1 As IO.FileInfo() = di.GetFiles()         Dim dra As IO.FileInfo         Try             ListView1.View = View.Details             ListView1.Items.Clear()             ListView1.Columns.Clear()             ListView1.Columns.Add("Filename", 250, HorizontalAlignment.Left)             Dim lCurrent As ListViewItem             For Each dra In diar1                 lCurrent = ListView1.Items.Add(dra.Name)                 lCurrent.SubItems.Add(dra.LastWriteTime)                 lCurrent.Tag = dra             Next         Catch ex As Exception             MessageBox.Show(ex.Message)         End Try

Any help will be appreciated,
Mike

Viewing all articles
Browse latest Browse all 42277

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>