/// <summary> /// Set the item state on the given item. /// </summary> /// <param name="list">The ListView whose item's state is to be changed.</param> /// <param name="itemIndex">The index of the item to be changed.</param> /// <param name="mask">Which bits of the value are to be set.</param> /// <param name="value">The value to be set.</param> public static void SetItemState(ListView list, int itemIndex, int mask, int value) { var lvItem = new LVITEM { stateMask = mask, state = value }; ListViewSelectionUtils.SendMessageLVItem(list.Handle, LVM_SETITEMSTATE, itemIndex, ref lvItem); }
/// <summary> /// Deselect all rows in the given ListView. /// </summary> /// <param name="list">The ListView whose items are to be deselected.</param> public static void DeselectAll(this ListView list) { ListViewSelectionUtils.SetItemState(list, -1, 2, 0); }