none
Custom form caption title and icon flickers when resize RRS feed

  • Question

  • 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 );
            }


    • Edited by Magi02 Wednesday, August 14, 2019 4:51 AM
    Wednesday, August 14, 2019 4:29 AM

All replies

  • Hi Magi02,

    Maybe you can try to override WndProc.

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

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

    Regards,

    Kyle


    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.

    Wednesday, August 14, 2019 5:15 AM
    Moderator