From 41de4140850ceabd127d9de619a924a24c6c0073 Mon Sep 17 00:00:00 2001 From: WithoutCaps Date: Thu, 22 Jun 2017 22:46:56 +0300 Subject: [PATCH] Added full application double buffering - decreases performance --- LimitlessUI/Form_WOC.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/LimitlessUI/Form_WOC.cs b/LimitlessUI/Form_WOC.cs index 8c0d31e..b8b0e69 100644 --- a/LimitlessUI/Form_WOC.cs +++ b/LimitlessUI/Form_WOC.cs @@ -54,6 +54,7 @@ public enum LinePositions private List _lines = new List(); private int _gripSize = 10; // Thickness of form grip which allows you to resize it private bool _drawShadow = true; + private bool _formLevelBuffering = true; private const int HTLEFT = 10, @@ -65,18 +66,16 @@ private const int HTBOTTOMLEFT = 16, HTBOTTOMRIGHT = 17; - - protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; if (_drawShadow) - { - const int CS_DROPSHADOW = 0x20000; - cp.ClassStyle |= CS_DROPSHADOW; - } + cp.ClassStyle |= 0x20000; + if (_formLevelBuffering && !DesignMode) + cp.ExStyle |= 0x02000000; + return cp; } } @@ -143,6 +142,12 @@ public bool DrawShadow } + public bool BufferApplication + { + get { return _formLevelBuffering; } + set { _formLevelBuffering = value; } + } + class Line { private int _x1;