2017-04-13 112 views
0

我有一個自定義控件的線條形狀。這個控件在我的面板中。每當我在面板上水平滾動,我的控制線都閃爍得很厲害。我一直在努力尋找解決方案,並且看過很多論壇和其他人的問題,但仍然沒有看到適合我的答案。VB.Net面板閃爍

+0

見:http://stackoverflow.com/a/7569645/495455和http://stackoverflow.com/questions/818415/how-do- i-double-buffer-a-panel-in-c –

回答

0

我認爲這是winforms,因爲你沒有wpf標籤。如果是這樣 - 試試這個 - 它可能會有所幫助。這有助於我有一個閃爍的問題。

你可以閱讀一下:http://www.vbmigration.com/detknowledgebase.aspx?Id=692

 


    Protected Overrides ReadOnly Property CreateParams() As CreateParams 
     'this is magic code that has an enormous positive effect on reducing flickering. 
     'don't remove this. 
     'found this nugget here: http://www.vbmigration.com/detknowledgebase.aspx?Id=692 
     Get 
      Dim params As CreateParams = MyBase.CreateParams 
      params.ExStyle = params.ExStyle Or &H2000000 
      Return params 
     End Get 
    End Property 

 
+0

欣賞回覆!它肯定有幫助 - 我會說閃爍減少了85%。 –

+0

遠遠沒有,你知道那篇文章有多大年齡......它的15歲。更好的方法是使用DoubleBuffering。 –

+0

我試過DoubleBuffering,它並沒有影響我的問題。 –