Перейти к основному контенту
Центр разработки для Windows

Custom form caption title and icon flickers when resize RRS feed

  • Вопрос

  • I have created custom form which inherited from MS form and customized the form caption by making its form border style as FormBorderStyle.FixedToolWindow. I have customized caption by fill with customized background and foreground. Every time when resize the window caption painting method triggers which cause background color overlap the foreground text which cause flickering in the caption. I have tried createparams method but still no improvement on this.How do resolve the flickering issue?

     protected override void PaintCaption(Graphics g, PaintArgs args)
            g.FillRectangle( brush, rectangle );
            g.DrawString( text, font, brush, rectangle, format );

    • Изменено Magi02 14 августа 2019 г. 4:51
    14 августа 2019 г. 4:29

Все ответы

  • Hi Magi02,

    Maybe you can try to override WndProc.

    protected override void WndProc(ref Message m)
        if (m.Msg == 0x0014)
        base.WndProc(ref m);

    Besides, to handle this issue more efficiently, could you provide the demo code that create custom form?



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    14 августа 2019 г. 5:15