I finally am going to make a concerted effort to learn VB.Net. So I installed VB.Net 2005 Express on my machine and away I go. I think the best way for me to learn how to program in VB.Net is to do it in small bits. I decided to start with the Listview. I want to learn how to use a listview and to do it properly meaning using it the way it is suppose to be used. Please take a look at my code and let me know how I can improve it.

VB Code:
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         'TODO: This line of code loads data into the 'FrontDataSet.Copy_of_Features' table. You can move, or remove it, as needed.
  5.         Dim a As Integer
  6.         With ListView1
  7.             .View = View.Details
  8.         End With
  9.  
  10.         Call lvwInitialize(ListView1)
  11.         Call DoTheChart()
  12.         Call ResizeForm()
  13.     End Sub
  14.  
  15.  
  16.     Private Sub lvwInitialize(ByVal lvw As ListView)
  17.         Dim lvh As ColumnHeader
  18.         Dim a As Integer
  19.  
  20.         With lvw
  21.             .Clear()
  22.             .FullRowSelect = True
  23.  
  24.             With .Columns
  25.                 For a = 1 To 3
  26.                     lvh = .Add("Column " & a)
  27.                     lvh.Width = lvw.Width / 3
  28.                 Next a
  29.             End With
  30.         End With
  31.  
  32.     End Sub
  33.  
  34.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  35.         Call LoadData(ListView1)
  36.     End Sub
  37.  
  38.     Private Sub LoadData(ByVal lvw As ListView)
  39.         Dim lvi As ListViewItem
  40.         Dim i As Integer
  41.         Dim a As Integer
  42.  
  43.         With lvw
  44.             .FullRowSelect = True
  45.             .View = View.Details
  46.             .Items.Clear()
  47.  
  48.             For i = 0 To 10
  49.                 lvi = New ListViewItem()
  50.                 lvi.Text = String.Format("Col1-Row{0}", i)
  51.  
  52.                 For a = 1 To .Columns.Count
  53.                     lvi.SubItems.Add("") '<=== Why do I need this line?
  54.                     lvi.SubItems(a).Text = String.Format("Col" & a & "-Row{0}", i)
  55.                 Next a
  56.  
  57.                 .Items.Add(lvi)
  58.             Next i
  59.         End With
  60.  
  61.     End Sub
  62.  
  63.     Private Sub ResizeForm()
  64.         Dim lvw As ListView
  65.         Dim lvh As ColumnHeader
  66.         Dim a As Integer
  67.  
  68.         lvw = ListView1
  69.  
  70.         If Me.WindowState = FormWindowState.Minimized Then Exit Sub
  71.  
  72.         With lvw
  73.             .Top = 0
  74.             .Left = 0
  75.             .Width = ClientSize.Width - 10
  76.             .Height = (ClientSize.Height) - 30
  77.  
  78.             With .Columns
  79.                 For a = 0 To .Count - 1
  80.                     lvh = .Item(a)
  81.                     lvh.Width = lvw.Width / 3
  82.                 Next a
  83.             End With
  84.         End With
  85.  
  86.         With Button1
  87.             .Top = ClientSize.Height - .Height - 5
  88.         End With
  89.     End Sub
  90.  
  91.     Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
  92.         Call ResizeForm()
  93.     End Sub
  94.  
  95. End Class

Thanks!