如何一次性显示项目列表框和索引

how to display the item listbox and index in one time

我想让列表框先有选中的索引,然后一次性获取项目,怎么办?

Dim Itemname
    Itemname = lstShipper.SelectedIndex

我只想让项目参考索引。

因为该项目可能会被更新..

不太确定你在问什么,但我猜你想在 ListBox 的索引更改时更新另一个控件。

ListBox.SelectedIndexChanged Event

从该事件中您可以获得 SelectedIndex 和 SelectedItem。

Dim curItem As String = listBox1.SelectedItem.ToString()

希望对您有所帮助。