Results 1 to 4 of 4

Thread: [Solved] Double Buffered?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    31

    [Solved] Double Buffered?

    Hello Guys,

    I have a problem
    I have a backgroundpicture in the form and 2 panels 'transparant'
    problem is now as I have a great many of buttons on the screen
    and when i scroll down my screen will flicker a lot
    I have set the form1 doublebuffered = true
    and i have used a code.
    And that works perfectly

    Code:
    Public Sub EnableDoubleBuffering()
            ' Set the value of the double-buffering style bits to true.
            Me.SetStyle(ControlStyles.DoubleBuffer _
              Or ControlStyles.UserPaint _
              Or ControlStyles.AllPaintingInWmPaint, _
              True)
            Me.UpdateStyles()
        End Sub
    if you don't have many buttons offcourse
    it start when you have a lot of buttons on the screen
    but when you scroll down its go all wrong

    and i have used the panel_paint but when i do that and set
    Code:
    doublebuffered = true
    and start it again its just flicker like crazy and the program stuck

    please somebody that can help?

    Dummy1912
    Last edited by Dummy1912; Jun 27th, 2010 at 09:22 AM.

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

    Re: Double Buffered?

    Hi Dummy1912,

    You have set the form's DoubleBuffered property to True, done it again with your EnableDoubleBuffering sub, and then again by putting doublebuffered=true your panel_paint sub. Making the form double buffered only affects the form's background, not the controls, even if you do it 3 times.

    You can make controls double buffered too, but it takes a little more work. Here's how you can make a double buffered a panel. Add a Class to your project, call it DoubleBufferedPanel (or whatever you like) and code it like this:
    vb.net Code:
    1. Public Class DoubleBufferedPanel
    2.     Inherits Panel
    3.     Public Sub New()
    4.         Me.DoubleBuffered = True
    5.     End Sub
    6. End Class
    Then you build the solution. The DoubleBufferedPanel will appear in the toolbox with a cogwheel icon. You can drag it onto a form and set its properties exactly like a normal panel.

    Maybe you already put a lot of work into setting you present Panel's controls and properties. If so, you can replace it by a DoubleBufferedPanel without changing anything else like this:

    1. In Solution Explorer, click the Show All Files button.
    2. Find your form's Designer.vb file and open it.
    3. Replace "System.Windows.Forms.Panel" wherever it occurs by "DoubleBufferedPanel".
    4. Save it and rebuild your solution.

    There is a good chance this will stop the flickering, but there could be other causes.

    BB

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    31

    Re: Double Buffered?

    hello boops boops,

    thanks i gone try it out
    hope its works.

    thanks alot.

    Dummy1912

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    31

    Re: Double Buffered?

    Great thanks boops boops

    i just a little bit but thats fine
    im glad is REALLY better now

    thank you so much

    Dummy1912

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