개발 노트

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

프로그래밍/C#

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

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

데이터그리드뷰네임명.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);
		}
	}

'프로그래밍 > C#' 카테고리의 다른 글

C# 데이터그리드뷰 focus 맞추기  (0) 2022.03.04
C# Delegate  (0) 2022.03.04
C#  (0) 2022.03.03
C# mqtt  (0) 2022.03.03
슬라이딩퍼즐  (0) 2022.03.02