개발 노트

데이터그리드뷰 suspendlayout(), resumelayout(), doublebufferd 본문

카테고리 없음

데이터그리드뷰 suspendlayout(), resumelayout(), doublebufferd

알 수 없는 사용자 2022. 4. 6. 15:35

dataGridView1.SuspendLayout();
dataGridView2.SuspendLayout();
dataGridView3.SuspendLayout();
dataGridView5.SuspendLayout();
dataGridView7.SuspendLayout();
dataGridView9.SuspendLayout();

 

dataGridView1.ResumeLayout();
dataGridView2.ResumeLayout();
dataGridView3.ResumeLayout();
dataGridView5.ResumeLayout();
dataGridView7.ResumeLayout();
dataGridView9.ResumeLayout();

 

 

 

//Put this class at the end of the main class or you will have problems.
public static class ExtensionMethods    // DoubleBuffered 메서드를 확장 시켜주자..
{
public static void DoubleBuffered(this DataGridView dgv, bool setting)
{
Type dgvType = dgv.GetType();
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetProperty);
pi.SetValue(dgv, setting, null);
}
}