일반

데이터그리드뷰 서스펜드레이아웃, 더블버퍼링

알 수 없는 사용자 2022. 3. 4. 11:29
SMALL

데이터그리드뷰네임명.DoubleBuffered(true);
데이터그리드뷰네임명.SuspendLayout();

 

더블버퍼드메소드 확장

	//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);
		}
	}
LIST