프로그래밍
c# 더블버퍼링
건우아빠유리남편
2010. 4. 5. 11:41
반응형
드디어 몇개월동안 고민했던 c# 더블버퍼링 문제 해결!
더블버퍼링 하는 법은 진작부터 알고 있었는데, panel에도 적용시켜줘야 한다는걸 몰랐다.
우리나라 싸이트에는 역시 해답이 없는데
구글에서 c# panel doublebuffering이라고 쳐서 해결
다음은 쓴 소스
public class DoubleBufferPanel : Panel
{
public DoubleBufferPanel()
{
// Set the value of the double-buffering style bits to true.
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
this.UpdateStyles();
}
}
이렇게 해준 후에 form1.designer.cs에 가서 panel 부분을 찾아준후 이렇게 바꿔주면 끝
panel1 = new System.Windows.Forms.Panel(); 을
panel1 = new DoubleBufferPanel();
아 기쁘다 내일은 얼른 세부구현 만들어서 넘겨야지!
해결하고 났더니 코딩하고 싶은 마음이 굴뚝같이 생김 ㅋㅋ
반응형