Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yet another solution:</p> <pre><code>//TODO: Don't forget to include using System.Runtime.InteropServices. internal static class NativeWinAPI { internal static readonly int GWL_EXSTYLE = -20; internal static readonly int WS_EX_COMPOSITED = 0x02000000; [DllImport("user32")] internal static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32")] internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); } </code></pre> <p>And your form constructor should look as follows:</p> <pre><code>public MyForm() { InitializeComponent(); int style = NativeWinAPI.GetWindowLong(this.Handle, NativeWinAPI.GWL_EXSTYLE); style |= NativeWinAPI.WS_EX_COMPOSITED; NativeWinAPI.SetWindowLong(this.Handle, NativeWinAPI.GWL_EXSTYLE, style); } </code></pre> <p>In the code above, you might change <code>this.Handle</code> to something like <code>MyFlickeringPanel.Handle</code></p> <p>You can read a bit more about it here: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx" rel="noreferrer" title="Extended Window Styles">Extended Window Styles</a> and here: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680%28v=vs.85%29.aspx" rel="noreferrer" title="CreateWindowEx">CreateWindowEx</a>.</p> <blockquote> <p>With WS_EX_COMPOSITED set, all descendants of a window get bottom-to-top painting order using double-buffering. Bottom-to-top painting order allows a descendent window to have translucency (alpha) and transparency (color-key) effects, but only if the descendent window also has the WS_EX_TRANSPARENT bit set. Double-buffering allows the window and its descendents to be painted without flicker.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload