首先,有一个输入框记录你要查询的定位的内容
然后在输入框加上TextChanged事件
然后在里面写上
int index = listBoxValues.Items.IndexOf(text.Text);
listBox.TopIndex = index;
listBox.SelectedIndex = index;
最后实现定位并选择到要查询的位置
首先,有一个输入框记录你要查询的定位的内容
然后在输入框加上TextChanged事件
然后在里面写上
int index = listBoxValues.Items.IndexOf(text.Text);
listBox.TopIndex = index;
listBox.SelectedIndex = index;
最后实现定位并选择到要查询的位置