Dim prog As New LinkLabel prog.Text = "C721" prog.Links.Add(0, Len(prog.Text), "www.google.co") Dim elem = New CustomElem With {.Progetto = prog, .Descrizione = "JK Rowling"} '.ToControls ', .Descrizione = "JK Rowling", .Note = "5.99D"} ListBox1.Items.Add(elem) Dim olink As New LinkLabel olink.Text = "Google" olink.Links.Add(0, Len(olink.Text), "www.google.co") ListBox1.Controls.Add(olink)
Public Class CustomElem Public Progetto As LinkLabel = Nothing Public Descrizione As String = "" Public Sub New(ByVal a As Control, ByVal b As String) Progetto = a Descrizione = b End Sub End class
Public Overrides Function ToString() As String Return Descrizione End Function