using System;
using System.Drawing;
using System.Windows.Forms;
public class Exercise : System.Windows.Forms.Form
{
ListView lvwCountries;
public Exercise()
{
InitializeComponent();
}
private void InitializeComponent()
{
Text = "Countries Statistics";
Size = new Size(452, 218);
lvwCountries = new ListView();
lvwCountries.Location = new Point(12, 12);
lvwCountries.Width = 420;
lvwCountries.Height = 160;
Controls.Add(lvwCountries);
}
}
public class Program
{
static int Main()
{
System.Windows.Forms.Application.Run(new Exercise());
return 0;
}
}

After this declaration, an empty rectangular control
is created and added to
your application. You can then start populating it.
|
Practical
Learning: Introducing the Tree View Control
|
|
- Start Microsoft Visual C#
- Create a new Windows Application named DeptStore1
- From the Common Controls section of the Toolbox, click ListView and click
the form
- While the list view is still selected, in the Properties window,
change the (Name) to lvwStoreItems

- Save the form
|
|