Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
What is the difference between it? It seems same to me.
Posted 12-Sep-11 16:14pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 at 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."
adit_sheth at 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)

  Print Answers RSS
0 Gihan Liyanage 332
1 Sergey Alexandrovich Kryukov 325
2 OriginalGriff 313
3 ClimerChinna 222
4 Zoltán Zörgő 170
0 Sergey Alexandrovich Kryukov 8,243
1 OriginalGriff 7,109
2 CPallini 2,598
3 Richard MacCutchan 1,980
4 Abhinav S 1,778


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100