Results 1 to 6 of 6

Thread: Why does my double buffered form still flicker?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Location
    Massachusetts
    Posts
    205

    Question Why does my double buffered form still flicker?

    I was wondering if it someone could help me solve this problem. I have a full screen application with a panel in the center which is used to display different user controls and screens when the user uses the app. However, I have a rather large gradient image set as my form's background and it causes the panel to flicker every time controls are added. I find that when the background image is removed the flicker goes away. How can I keep the background image but eliminate the flicker? My form is already double buffered. Any help would be appreciated. Thanks.
    Always looking to meet fellow programmers. Message me if you want. Happy to help in whatever ways I can

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Why does my double buffered form still flicker?

    By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Why does my double buffered form still flicker?

    Create a buttered panel... Search for buffered panel

    Kris

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Location
    Massachusetts
    Posts
    205

    Re: Why does my double buffered form still flicker?

    Quote Originally Posted by weirddemon View Post
    By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
    The background image is already set to stretch. Is there any way to disable the image from repainting each time a control is added to the panel?
    Always looking to meet fellow programmers. Message me if you want. Happy to help in whatever ways I can

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Location
    Massachusetts
    Posts
    205

    Re: Why does my double buffered form still flicker?

    Quote Originally Posted by weirddemon View Post
    By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
    The background image is already set to stretch. Is there any way to disable the image from repainting each time a control is added to the panel?
    Always looking to meet fellow programmers. Message me if you want. Happy to help in whatever ways I can

  6. #6
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Why does my double buffered form still flicker?

    Setting the form's DoubleBuffered property doesn't make the panel double buffered. Changing the children of the panel at runtime could be causing the flickering. The Panel class has a DoubleBuffered property but it is Protected. One way to set it is to make a class which inherits from Panel:
    vb Code:
    1. Public Class DBPanel
    2.     Inherits Windows.Forms.Panel
    3.     Public Sub New()
    4.         Me.DoubleBuffered = True
    5.     End Sub
    6. End Class
    Then you use the DBPanel instead of a normal Panel.

    BB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width