Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试查看是否选中了选中列表框中的特定项目。我假设引用该项目将是:
var checkBox = CheckBoxCheckedListBox1.Items[0];
但这会返回一个对象。投射到 CheckBox 会引发异常。
谢谢!
在这里使用bool checked = CheckBoxCheckedListBox1.GetItemChecked(i)。
bool checked = CheckBoxCheckedListBox1.GetItemChecked(i)