개발 노트

doublebuffer 본문

프로그래밍/C#

doublebuffer

알 수 없는 사용자 2022. 2. 21. 14:41

using System.Reflection; // 더블버퍼링 하기 위해서 추가

 

namespace 네임스페이스이름
{
    public partial class Form1 : Form
    {
        public formReservation()
        {
            InitializeComponent();

 

            dataGridView1.DoubleBuffered(true);       // 확장하기

        }

    }

 

   
    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#' 카테고리의 다른 글

sql union all, 탭인덱스  (0) 2022.02.24
static  (0) 2022.02.23
차트 타이틀 설정  (0) 2022.02.21
차트공부2  (0) 2022.02.18
차트공부1  (0) 2022.02.18