locked
How to remove flickering from Windows Form in C#? RRS feed

  • Question

  • hi All
    I have more number of textboxes on my form and am hiding some textboxes based on some condition. At the time of hiding i get flicker on my form, any solution for flicker free form?
    Thanks
    Wednesday, March 10, 2010 7:36 AM

Answers


  • Set Form's Double buffered property to True.

    A brief guide here > http://social.msdn.microsoft.com/forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c/
    Thanks

    Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
    My BlogMy Facebook
    • Marked as answer by Helen Zhou Friday, March 12, 2010 9:27 AM
    Wednesday, March 10, 2010 8:00 AM
  • Hi AristocratP,

    Set this.DoubleBuffered = true;

    DoubleBuffered works inside one control to avoid flickering during repaint.

    The WS_EX_COMPOSITED imports the same logic but for container when repainting its indivdual child controls.

    Sincerely,
    Helen Zhou


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Helen Zhou Friday, March 12, 2010 9:27 AM
    Friday, March 12, 2010 9:27 AM

All replies


  • Set Form's Double buffered property to True.

    A brief guide here > http://social.msdn.microsoft.com/forums/en-US/winforms/thread/aaed00ce-4bc9-424e-8c05-c30213171c2c/
    Thanks

    Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
    My BlogMy Facebook
    • Marked as answer by Helen Zhou Friday, March 12, 2010 9:27 AM
    Wednesday, March 10, 2010 8:00 AM
  • Hi AristocratP,

    Set this.DoubleBuffered = true;

    DoubleBuffered works inside one control to avoid flickering during repaint.

    The WS_EX_COMPOSITED imports the same logic but for container when repainting its indivdual child controls.

    Sincerely,
    Helen Zhou


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Helen Zhou Friday, March 12, 2010 9:27 AM
    Friday, March 12, 2010 9:27 AM
  • That (setting the form's DoubleBuffered property to true) doesn't seem to do a thing for me.

    And if it did, it would beg the question: Why isn't it true by default?


    B. Clay Shannon

    Monday, May 7, 2012 10:23 PM