From 4e80a87b8cb6bd109c055a8f0b7c72d24a64b8a8 Mon Sep 17 00:00:00 2001 From: Robert Jordan Date: Tue, 29 Aug 2023 18:22:13 -0400 Subject: [PATCH] Add missing SuspendPaint in SelectWhere, UnselectWhere SuspendPaint was missing to match the ResumePaint call in these two functions, thus throwing off the counter, and causing all kinds of visual issues when attempting to use these functions. --- ImageListView/ImageListView.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ImageListView/ImageListView.cs b/ImageListView/ImageListView.cs index bb2854a..25c9f7f 100644 --- a/ImageListView/ImageListView.cs +++ b/ImageListView/ImageListView.cs @@ -1107,6 +1107,8 @@ public void InvertSelection() /// public void SelectWhere(Func predicate) { + SuspendPaint(); + foreach (ImageListViewItem item in Items.Where(predicate)) item.mSelected = true; @@ -1120,6 +1122,8 @@ public void SelectWhere(Func predicate) /// public void UnselectWhere(Func predicate) { + SuspendPaint(); + foreach (ImageListViewItem item in Items.Where(predicate)) item.mSelected = false;