vishalmarya
New member
i want to add items in a listbox along with its corresponding id.my code :
result shown on the form is :windowsapplication1.form1+class1windowsapplication1.form1+class1Any suggestions.
VB.NET:
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim obj As class1obj = New class1
obj.name = "xyz"
obj.id = 1
ListBox1.Items.Add(obj)
obj = New class1
obj.name = "pqr"
obj.id = 2
ListBox1.Items.Add(obj)
End Sub
Private Class class1
Public name As String
Public id As Integer
End Class
Last edited by a moderator: