/// <summary>
/// 查找并勾选某个元素方法-按值查找
/// </summary>
void SetItemCheckedByValue(CheckedListBoxControl clbc, object value)
{
ListBoxFindItemDelegate lbfid = delegate(ListBoxFindItemArgs f) { f.IsFound = object.Equals(value, f.ItemValue); };
int a = clbc.FindItem(0, true, lbfid);
if (a >= 0)
clbc.SetItemChecked(a, true);
}
/// <summary>
/// 查找并勾选某个元素方法-按内容查找
/// </summary>
void SetItemCheckedByText(CheckedListBoxControl clbc, string text)
{
int a = clbc.FindString(text);
if (a > 0)
clbc.SetItemChecked(a, true);
}
/// <summary>
/// 查找并勾选某个元素方法-按内容模糊查找
/// </summary>
void SetItemCheckedByMatchText(CheckedListBoxControl clbc, string text)
{
int a = clbc.FindStringExact(text);
if (a > 0)
clbc.SetItemChecked(a, true);
}