我已經將其他代碼寫在了InitializeComponent()下,也試過將代碼全部刪了,雙緩沖和解決閃爍也用上了,doublebuffer也設為truel了,實測為因為panel過多,導致跳轉慢,請問有哪些方法可以解決panel有25個,用panel的原因是因為很方便。
uj5u.com熱心網友回復:
請問哪位大佬來指點一下,最近網上看了好多方法都沒解決。主要還搜不到更多的辦法了。uj5u.com熱心網友回復:
Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(() =>{
Action act = delegate ()
{
newform.SuspendLayout();
newform.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(newform, true, null);
newform.Visible = true;
newform.Location = new Point(0, 0);
newform.Size = this.Size;
newform.BringToFront();
底部.BringToFront();
頂部.BringToFront();
uc.Dock = DockStyle.Fill;//填充panel
this.newform.Controls.Add(uc);
this.newform.ResumeLayout();
};
this.Invoke(act);
}));
thread.Start(); //啟動執行緒
uj5u.com熱心網友回復:
這上面是跳轉的代碼,實測panel過多的用戶控制元件跳轉慢。轉載請註明出處,本文鏈接:https://www.uj5u.com/net/55418.html
標籤:C#
