Displaying ListView items - with class! by Rob Birdwell
nally add three columns to the ListView: Name, Rank and Serial Number. If you add the columns, be sure to set the View property of PersonListView to "Report." In the form code, we'll add the PersonListItem objects via a simple helper function, called from the form's constructor, as follows:
private void InitPersonListView()
{
// Load our PersonListView with our important people:
PersonListView.InsertItem(PersonListView.ListItems.Count,
new PersonListItem(new Person("Rob Birdwell", "Private", "123456")));
private void InitPersonListView()
{
// Load our PersonListView with our important people:
PersonListView.InsertItem(PersonListView.ListItems.Count,
new PersonListItem(new Person("Rob Birdwell", "Private", "123456")));
| 对此文章发表了评论 |

