0
我試圖在標籤中顯示列表框項目。 調試後,我得到的錯誤:「確保名單上的maximun指數小於列表的大小」如何使用VB2008將列表框項目顯示爲標籤
任何評論將是高度讚賞,
Private Sub xMultiButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles xMultiButton.Click
Dim count As Integer
count = Me.xNamesListBox.Items.Count
For count = 0 To 3
Me.xResultLabel.Text = Me.xNamesListBox.SelectedItems.Item(0).ToString & ControlChars.NewLine _
& Me.xNamesListBox.SelectedItems.Item(1).ToString & ControlChars.NewLine _
& Me.xNamesListBox.SelectedItems.Item(2).ToString & ControlChars.NewLine _
& Me.xNamesListBox.SelectedItems.Item(3).ToString & ControlChars.NewLine _
& Me.xNamesListBox.SelectedItems.Item(4).ToString
Next
End Sub
它工作完美,只使用整數作爲數據類型...非常感謝。 – Cecilia 2011-01-11 15:12:56