문제

C# (Windows Forms)을 사용하여 컨트롤을 이중 부러지는 방법은 무엇입니까?

나는 물건을 그린 패널 컨트롤과 소유자가 그린 탭 컨트롤을 가지고 있습니다. 둘 다 깜박임으로 고통을 겪으므로 어떻게 이중 소란을 활성화 할 수 있습니까?

도움이 되었습니까?

해결책

통제의 생성자에서 더블 버퍼가있는 속성 및/또는 제어 스타일을 적절하게 설정하십시오.

예를 들어, 제작자가 다음과 같은 간단한 DoubleBufferedPanel이 있습니다.

this.DoubleBuffered = true;
this.SetStyle(ControlStyles.UserPaint | 
              ControlStyles.AllPaintingInWmPaint |
              ControlStyles.ResizeRedraw |
              ControlStyles.ContainerControl |
              ControlStyles.OptimizedDoubleBuffer |
              ControlStyles.SupportsTransparentBackColor
              , true);

다른 팁

System.windows.forms.control에서 상속 된 DoubleBuffered 속성을 사용하십시오.

System.Windows.Forms.Form myForm = new System.Windows.forms.Form();
myForm.DoubleBuffered = true;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top