Hello Friends,
I am converting VB 6 code to VB.Net in VS 2010, Framework 4.
I am unable to find equivalent code in VB.Net for
ListBox1.Items.Add(New VB6.ListBoxItem("Sam",0))
Error Message: "'Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem' is obsolete".
I tried "ListBox1.Items.Add(New ListItem("Sam",0))" but it is not working though I added
"Imports System.Windows.Forms.ListViewItem".
Error Message: "Public Function Format(Expression As Object, [Style As String = ""], [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As String' is obsolete".
Eagerly waiting for an answer.
Simran Kaur.

I have never used vb6, but in vb.net if you want to add an item to a listbox, you would use...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.