添加一个FlowLayoutPanel1(在工具箱--容器里面) 一个Button1
代码如下:
脊野 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
段野则 Dim url As String = InputBox("输入网站地址?", "输入", "http://")
If url = "" Then Return
Dim link As New LinkLabel
link.Text = url
link.AutoSize = True
FlowLayoutPanel1.Controls.Add(link)
握棚 AddHandler link.LinkClicked, AddressOf Link_LinkClicked
End Sub
Private Sub Link_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
Dim url As String = CType(sender, LinkLabel).Text
Process.Start(url)
End Sub
效果如图: