我有一个字符串'item3'和一个带有'item1,item2,item3,item4'的列表框,当我在字符串中有项目名称时,如何在列表框中选择item3?
谢谢
Nes*_*cio 15
int index = listBox1.FindString("item3");
// Determine if a valid index is returned. Select the item if it is valid.
if (index != -1)
listBox1.SetSelected(index,true);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
50255 次 |
| 最近记录: |