SpeakComputers.com
Home
Software
Electronics
Desktop Computers
Laptops
Games
Handheld Devices
Mobile Phones
Cameras
Camcorders
Printers
Books
Software Downloads 2012 Software Mac Software Security Student Editions Windows 7 Office 2010
ASP.NET C# VB.NET C++ .NET Infragistics DevComponents

ListView Control.

The System.Windows.Forms.ListView control enabled you to display a list of items from which the user can select one or multiple items from the list. Each item displayed within the ListView can have an optional icon associated with the item type it is representing. You can set the view property to Large Icons, Small Icons, Details, List and Tile.

Namespace: System.Windows.Forms
Assembly: Systems.Windows.Forms.dll

using System.Windows.Forms;
Calling: System.Windows.Forms.ListView


Creating a new System.Windows.Forms.ListView control.
ListView listView1 = new ListView();

Adding the ListView control to a Windows form.
this.Controls.Add(listView1);

Adding items to the ListView control. You can add ListViewItems or String items to he ListView control.
ListViewItem li = new ListViewItem("apple");
li.ImageIndex = 1;
//The ImageIndex is the index of a lis of images from the ImageList.
listView1.Items.Add(li);

ListView items can use check box states simply by assigning the true boolean value to the CheckBoxes value.
listView1.CheckBoxes = true;

To create an ItemChecked event for the ListView control.
listView1.ItemChecked +=new ItemCheckedEventHandler(listView1_ItemChecked);

To respond to the ItemChecked event.
private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e)
{
MessageBox.Show(e.Item.Text);
}

To sort the columns when using the Details view you need to create ColumnClick event.
listView1.ColumnClick +=new ColumnClickEventHandler(listView1_ColumnClick);

To repond to the ListView ColumnClick event.
private void listView1_ColumnClick(object sender, ColumnClickEventArgs e) { //ColumnClick event code }
Computer Security
AntiVirus Software
Internet Security
Parental Controls
Backup & Recovery
Computer Protection
Anti Malware
Photo & Video
Photo & Video Editing
Video Music
Desktop Publishing
Professional Design
Home Publishing
Clipart
Business & Accounting
Accounting
Payroll
Check Printing
TAX
H&R Block
Microsoft Office
Design
Graphic Design
Home Design
Garden Design
Interior Design
Computer Aided Design
3D Design
Students & Teacher
Adobe
Microsoft Office
Dragon Naturally Speaking
Corel Draw
Serif
Student/Teacher Software
Copy Right 2006 SpeakComputers.com - All Rights Reserved.
Home About Privacy Policy Resouces