다음을 통해 공유


Control.UpdateStyles 메서드

할당된 스타일이 컨트롤에 강제로 다시 적용되도록 합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Protected Sub UpdateStyles
‘사용 방법

Me.UpdateStyles
protected void UpdateStyles ()
protected:
void UpdateStyles ()
protected void UpdateStyles ()
protected function UpdateStyles ()

설명

이 메서드는 CreateParams 메서드를 호출하여 적용할 스타일을 가져옵니다. Style에 할당된 스타일과 컨트롤의 CreateParams 속성에 할당된 CreateParamsExStyle 속성이 다시 적용됩니다. 필요한 경우 스타일을 반영하기 위해 컨트롤을 다시 그립니다.

IsHandleCreated 속성 값이 false이면 UpdateStyles 메서드를 적용해도 효과가 없습니다.

예제

다음 코드 예제에서는 Form에 이중 버퍼링을 사용하고 해당 스타일을 업데이트하여 변경 사항을 반영합니다.

Public Sub EnableDoubleBuffering()
   ' Set the value of the double-buffering style bits to true.
   Me.SetStyle(ControlStyles.DoubleBuffer _
     Or ControlStyles.UserPaint _
     Or ControlStyles.AllPaintingInWmPaint, _
     True)
   Me.UpdateStyles()
End Sub
public void EnableDoubleBuffering()
{
   // Set the value of the double-buffering style bits to true.
   this.SetStyle(ControlStyles.DoubleBuffer | 
      ControlStyles.UserPaint | 
      ControlStyles.AllPaintingInWmPaint,
      true);
   this.UpdateStyles();
}
public:
   void EnableDoubleBuffering()
   {
      // Set the value of the double-buffering style bits to true.
      this->SetStyle( static_cast<ControlStyles>(ControlStyles::DoubleBuffer | ControlStyles::UserPaint | ControlStyles::AllPaintingInWmPaint), true );
      this->UpdateStyles();
   }
public void EnableDoubleBuffering()
{
    // Set the value of the double-buffering style bits to true.
    this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | 
        ControlStyles.AllPaintingInWmPaint, true);
    this.UpdateStyles();
} //EnableDoubleBuffering

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

Control 클래스
Control 멤버
System.Windows.Forms 네임스페이스
CreateParams