diff --git a/TeddyBench/Extensions.cs b/TeddyBench/Extensions.cs new file mode 100644 index 0000000..017be59 --- /dev/null +++ b/TeddyBench/Extensions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TeddyBench +{ + public static class Extensions + { + public static void DoubleBuffered(this Control control, bool enable) + { + var doubleBufferPropertyInfo = control.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); + doubleBufferPropertyInfo.SetValue(control, enable, null); + } + + } +} diff --git a/TeddyBench/TeddyMain.cs b/TeddyBench/TeddyMain.cs index f19ba3b..2ec8a89 100644 --- a/TeddyBench/TeddyMain.cs +++ b/TeddyBench/TeddyMain.cs @@ -202,6 +202,7 @@ public TeddyMain() lstTonies.LargeImageList.Images.Add("unknown", ResizeImage(Resources.unknown, 128, 128)); lstTonies.LargeImageList.Images.Add("custom", ResizeImage(Resources.custom, 128, 128)); lstTonies.ListViewItemSorter = new ListViewItemComparer(2); + lstTonies.DoubleBuffered(true); cmbSorting.SelectedIndex = 2; Text = TitleString;