我如何"转换"我的列表框项目到同一行?
示例:
>
item1 item2 item3
我的提取代码,用于将项目添加到列表框。
Dim PageElement As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
For Each CurElement As HtmlElement In PageElement
If (CurElement.GetAttribute("id") = "info1") + (CurElement.GetAttribute("id") = "info2") Then
ListBox2.Items.Add(CurElement.InnerText)
correct()
End If
Next
答案 0 :(得分:0)
你可以试试这个: 定义一个字符串:
Dim Line As String = ""
然后将此代码放入For循环中:
Line = Line & CurElement.InnerText & " "
然后把它放在For循环下面:
Line = Line.Remove(Line.Length - 1, 1)
ListBox1.Items.Add(Line)