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