How do I double buffer a Panel?

前端 未结 5 1922
一个人的身影
一个人的身影 2020-11-29 06:38

I have a panel that has a roulette wheel on it, and I need to double buffer the panel, so that it stops flickering. Can anyone help me out?

EDIT:

Yes, I have

5条回答
  •  难免孤独
    2020-11-29 07:06

    Just expanding on User79775's answer, if you're trying to achieve this in VB.net, do so like this:

    Imports System.Windows.Forms
    
    Public Class MyDisplay
        Inherits Panel
    
        Public Sub New()
            Me.DoubleBuffered = True
    
            ' or
    
            SetStyle(ControlStyles.AllPaintingInWmPaint, True)
            SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
            UpdateStyles()
        End Sub
    End Class
    

提交回复
热议问题