0
我的控件出現閃爍問題。我有拖放操作,拖動控件時,它閃爍。我該如何解決它?我試過這個Windows窗體中的閃爍問題
public Form1()
{
InitializeComponent();
.
.
.
this.DoubleBuffered = true;
}
但是沒有爲我工作。我該如何解決它?
我的控件出現閃爍問題。我有拖放操作,拖動控件時,它閃爍。我該如何解決它?我試過這個Windows窗體中的閃爍問題
public Form1()
{
InitializeComponent();
.
.
.
this.DoubleBuffered = true;
}
但是沒有爲我工作。我該如何解決它?
public static void SetDoubleBuffered(System.Windows.Forms.Control c)
{
//Taxes: Remote Desktop Connection and painting
//http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx
if (System.Windows.Forms.SystemInformation.TerminalServerSession)
return;
System.Reflection.PropertyInfo aProp =
typeof(System.Windows.Forms.Control).GetProperty(
"DoubleBuffered",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance);
aProp.SetValue(c, true, null);
}
該方法有很多幫助。
從這裏
請不要在這裏重複的答案。如果這對你有用,那麼你的問題應該作爲一個副本關閉。 –
什麼樣的控件都閃爍了?你包含一個用戶控件標籤。您的DoubleBuffered設置僅用於表單,而不是控件。 – LarsTech
我的控件是面板LarsTech –
請參見[如何將緩衝區窗體上的.NET控件加倍緩衝?](http://stackoverflow.com/q/76993/719186) – LarsTech