Control.UpdateStyles 메서드

정의

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

protected:
 void UpdateStyles();
protected void UpdateStyles ();
member this.UpdateStyles : unit -> unit
Protected Sub UpdateStyles ()

예제

다음 코드 예제에서는 a에서 Form 이중 버퍼링을 사용하도록 설정하고 변경 내용을 반영하도록 스타일을 업데이트합니다.

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();
}
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

설명

이 메서드는 메서드를 CreateParams 호출하여 적용할 스타일을 가져옵니다. 컨트롤 CreateParams 의 속성에 Style 할당된 스타일 및 ExStyle 속성 CreateParams 이 다시 적용됩니다. 필요한 경우 스타일 변경 내용을 반영하도록 컨트롤이 다시 그려집니다.

속성 값false이 .인 UpdateStyles 경우 메서드는 IsHandleCreated 영향을 주지 않습니다.

적용 대상

추가 정보