List views displays a collection of items that can be displayed using one of five different views, such as LargeIcon, Details , SmallIcon, List and Tile.
Add Columns in VB.Net ListView
You can add columns in Listview by using Columns.Add() method. This method takes two arguments, first one is the Column heading and second one the column width.
In the above code, "ProductName" is column heading and 100 is column width.
Add Item in VB.Net Listview
You can add items in listbox using ListViewItem which represents an item in a ListView control.
Get selected item from VB.Net ListView
Above code will return the itme from first column of first row.
Sorting VB.Net Listview Items
If the Sorted property of Listview is set to true, then the ListView items are sorted. The following code sorts the ListView items:
Add Checkbox in Listview
You can add checkbox in VB.Net Listview columns.
ListView provides a large number of properties that provide flexibility in appearance and behavior. The View property allows you to change the way in which items are displayed. and the SelectionMode property determines how many items in the list can be selected at a time.
The following Vb.Net program first set its view property as Details and GridLines property as true and FullRowSelect as true.
Finally in the button click event, it will display the selected row values in a message box.
- Visual Studio IDE
- How to Create a vb.net Windows Forms Application
- Label Control
- Button Control
- TextBox Control
- ComboBox Control
- ListBox Control
- Checked ListBox Control
- RadioButton Control
- CheckBox Control
- PictureBox Control
- ProgressBar Control
- ScrollBars Control
- DateTimePicker Control
- Treeview Control
- Menu Control
- MDI Form
- Color Dialog Box
- Font Dialog Box
- OpenFile Dialog Box
- Print Dialog Box
- KeyPress event in VB.NET , KeyDown Event in VB.Net , KeyUp Event in VB.Net
- How to create Dynamic Controls in VB.NET ?
- How do i keep a form on top of others
- Timer Control - VB.Net