4

私はWindowsフォームアプリケーションを作成していますが、主に私の画面は次のような3つの部分に分かれています

===========================================================================
                    Top panel (it doesn't flicker)
===========================================================================
||         || 'it has a panel & panel contains a table layout,this tabble layout'
||         || 'has a picture box and a label, picture & text of label is'           
||         ||'changed on the click of side bar menu' (PROB: this flickers a lot)
||side bar ||==============================================================
||(doesn't ||'this part also has a panel and panel contains different table'
||flicker) ||'layouts and on the click of a menu, related table layout is shown and'  
||         ||'some of the parts of table layout are created dynamically.'
||         ||           
||         ||                (PROB: this flickers a lot)
||         ||

私はたくさん検索し、どこでもこの解決策を見つけ、これを試しました

public constructor()
    {
        InitializeComponent();
        this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        this.DoubleBuffered = true;
        DoubleBuffered = true;
        SetStyle(ControlStyles.UserPaint |
                      ControlStyles.AllPaintingInWmPaint |
                      ControlStyles.ResizeRedraw |
                      ControlStyles.ContainerControl |
                      ControlStyles.OptimizedDoubleBuffer |
                      ControlStyles.SupportsTransparentBackColor
                      , true);
    }

私もこれを試しました

protected override CreateParams CreateParams
{
get
{
CreateParams handleParam = base.CreateParams;
handleParam.ExStyle |= 0x02000000;   // WS_EX_COMPOSITED       
return handleParam;
}
}

画面の背景全体が黒色に変わります。

しかし、それでも問題は同じままです。誰かがこの問題を解決する方法と、どこで間違いを犯しているのか教えてもらえますか? よろしくお願いします。

4

1 に答える 1