Listbox is different from VB 6.0

I have been using Listbox in VB 6.0 and using its multicolumn property, we could use the Listbox to display information as in a table. But the current VB.Net Listbox control displays information as a continuation in the second column rather than as a table. Am I missing some property?

Is there any control which I can use to display information as in a table, on the form?

Regards,
Srinivas
srinivas_vemlaAsked:
Who is Participating?
 
RonaldBiemansCommented:
here is a small example (I know it doesn't sense but it is just an example) (just drag a listview from the toolbox onto your form)

        ListView1.View = View.Details
        ListView1.Columns.Add("col1", 20, HorizontalAlignment.Center)
        ListView1.Columns.Add("col2", 50, HorizontalAlignment.Center)
        ListView1.Columns.Add("col3", 60, HorizontalAlignment.Right)
        Dim x As ListViewItem
        x = ListView1.Items.Add("hallo")
        x.SubItems.Add("10")
        x.SubItems.Add("20")

if you need more specific information , just ask
0
 
RonaldBiemansCommented:
the datagrid ?
0
 
RonaldBiemansCommented:
or the listview
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
RonaldBiemansCommented:
the listview is more like the vb6 listbox multicolumn format
0
 
srinivas_vemlaAuthor Commented:
Thanks Ronald for the quick comments...

I have tried using the DataGrid, but it displays table in a "tabular" fashion and I did not really like the way it displayed. I just wanted a display as in HTML <table> element.

I am not sure how to use the listview for this... any sample code or links????

Thanks,
Srinivas
0
 
RonaldBiemansCommented:
Is this a web or a windows app ?
0
 
RonaldBiemansCommented:
also the information you want to show, is this information in a table/dataset ?
0
 
srinivas_vemlaAuthor Commented:
This is a window app...

This information comes dynamically from my code... not the database... so I can put it in a DataTable...

0
 
srinivas_vemlaAuthor Commented:
Looks good...

Thanks Ronald... I will use the ListView...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.