Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
4.20/5 (2 votes)
See more:
What is the difference between it? It seems same to me.
Posted

Have a look at the class inheritance hierarchy -

ListVIew
System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        System.Windows.Forms.ListView


ListBox
System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        System.Windows.Forms.ListControl
          System.Windows.Forms.ListBox
            Microsoft.VisualBasic.Compatibility.VB6.DirListBox
            Microsoft.VisualBasic.Compatibility.VB6.FileListBox
            System.Windows.Forms.CheckedListBox


A ListView can be displayed using one of four different views.
 
Share this answer
 
v2
The ListView control is used to display the values from a data source. It resembles the GridView control, except that it displays data by using user-defined templates instead of row fields. Creating your own templates gives you more flexibility in controlling how the data is displayed.

The ListView is exactly like the Windows Explorer lists, allowing views for tiles, detail, icons. ListView also allows other properties like unique colors for each item, and checkboxes.

ListBox is much simpler, vertical only list.
 
Share this answer
 
Comments
Luiey Ichigo 13-Sep-11 2:13am    
Hi adit,

Is listbox able to view some sort of data that have 3 column? Right now, I try to put a data from textbox and datetimepicker to the listbox. But it failed. Also i try using listview. It also failed. The error appears is "because no accessible "Add" can be called without narrowing conversion."
AditSheth 13-Sep-11 4:46am    
You can not view 3 Column in listbox.Listbox only view single column. If you want to display 3 column you have to convert it into string and then add to listbox.
For example Let go for your textbox value and datetimepicker value
if you want to display this both to listbox
pass parameter as string
lb.Items.Add(textbox.value + "-" + datetimepicker value)
let my textbox value is "hello" and datetime picker value is "13/9/2011"
it will add hello-13/9/2011 to listbox

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900