Click here to Skip to main content
Sign Up to vote bad
good
See more: VB.NET
What is the difference between it? It seems same to me.
Posted 12 Sep '11 - 16:14


2 solutions

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.
  Permalink  
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.
  Permalink  
Comments
fadhliazmin - 13 Sep '11 - 2:13
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."
adit_sheth - 13 Sep '11 - 4:46
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 343
1 Sergey Alexandrovich Kryukov 143
2 Mohammed Hameed 123
3 Santhosh G_ 113
4 Ron Beyer 64
0 Sergey Alexandrovich Kryukov 8,266
1 OriginalGriff 6,516
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 13 Sep 2011
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid