title: Working with ListView in C++
body: <p>I got a stupid question on <em>ListView Control</em> usage.
  I created a Windows Form App in VS2005. No I dragged a ListView Control from the toolbox. I want to implement my code to show some content(including both columns and rows). 
  I know a little of MFC knowledge. I am not sure I must study the past MFC CListCtrol knowledge to implement my application or I can just study the <code>System.Windows.Forms::ListView</code> simply. </p>
  
  <p>I found a good sample working with ListView (but wrote in C#). Can I translate the sample code from C# to C++ in VS2005? If I can. Could you please give me some suggestions?</p>
  
  <pre><code>using System;
  using System.Windows.Forms;
  using System.Drawing;
  
  public class ListView1 : Form {
    ListView listView = new ListView();
  
    public ListView1() {
      listView.Dock = DockStyle.Fill;
      PopulateListView();
      this.Controls.Add(listView);
      this.ClientSize = new Size(400, 200);
    }
  
  
    private void PopulateListView() {
      // Set the view to show details.
      listView.View = View.Details;
  
      // Add columns
      listView.Columns.Add("Author", 
                           -2, 
                           HorizontalAlignment.Center);
      listView.Columns.Add("Title", 
                           -2, 
                           HorizontalAlignment.Left);
      listView.Columns.Add("Price", 
                           -2, 
                           HorizontalAlignment.Left);
  
      // Add items
      ListViewItem item1 = new ListViewItem("Steve Martin");
      item1.SubItems.Add("Programming .NET");
      item1.SubItems.Add("39.95");
  
      ListViewItem item2 = new ListViewItem("Irene Suzuki");
      item2.SubItems.Add("VB.NET Core Studies");
      item2.SubItems.Add("69.95");
  
      ListViewItem item3 = new ListViewItem("Ricky Ericsson");
      item3.SubItems.Add("Passing Your .NET Exams");
      item3.SubItems.Add("19.95");
  
      // Add the items to the ListView.
      listView.Items.AddRange(
                              new ListViewItem[] {item1, 
                                                  item2, 
                                                  item3}
                              );
    }
  
    public static void Main() {
      ListView1 form = new ListView1();
      Application.Run(form);
    }
  }
  </code></pre>