gpt4 book ai didi

vb.net - 如何检查列表框中所选项目中的某些特定单词?

转载 作者:行者123 更新时间:2023-12-01 04:01:12 24 4
gpt4 key购买 nike

我试过:

  • 如果 ListBox1.Items.Contains("myword") 那么
  • 如果 ListBox1.SelectedIndex = ListBox1.Items.IndexOf("myword") 那么
  • 如果 ListBox1.SelectedItems.Item("myword") 那么

  • 但没有效果。

    最佳答案

    尝试这样的事情,listbox.items属性是 ListBox.ObjectCollection :

    For Each i As Object In ListBox1.SelectedItems
    If CStr(i).Contains("myword") Then
    BackColor = Color.Blue ' Do your logic here, I just used setting the BackColor for a test
    End If
    Next

    关于vb.net - 如何检查列表框中所选项目中的某些特定单词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13371746/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com