[C#] ListView DoubleBuffered 속성설정

ListView나 일반 컨트롤들의 non-public methods인 DoubleBuffered 속성을 Reflection을 이용해서 설정하는 방법

public static void
SetDoubleBuffered(Control control)
{
  // set instance non-public property with name "DoubleBuffered" to true
  typeof(Control).InvokeMember("DoubleBuffered",
      BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
      null, control, new object[] { true });
}
나의일/.NET 2010/05/06 18:13

트랙백 주소 : http://www.ddosori.net/trackback/321

댓글을 달아 주세요

Powerd by Tistory, designed by criuce
rss