Control.GetStyle(ControlStyles) 메서드

정의

컨트롤에 대해 지정된 컨트롤 스타일 비트의 값을 검색합니다.

protected:
 bool GetStyle(System::Windows::Forms::ControlStyles flag);
protected bool GetStyle (System.Windows.Forms.ControlStyles flag);
member this.GetStyle : System.Windows.Forms.ControlStyles -> bool
Protected Function GetStyle (flag As ControlStyles) As Boolean

매개 변수

flag
ControlStyles

값을 반환할 ControlStyles 비트입니다.

반환

Boolean

지정된 컨트롤 스타일 비트가 true로 설정되어 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 에 대한 Form이중 버퍼링 관련 스타일 비트의 값을 반환합니다. 이 예제에서는 모든 스타일 비트가 로 설정된 true경우에만 반환 true 합니다.

public:
   bool DoubleBufferingEnabled()
   {
      
      // Get the value of the double-buffering style bits.
      return this->GetStyle( static_cast<ControlStyles>(ControlStyles::DoubleBuffer | ControlStyles::UserPaint | ControlStyles::AllPaintingInWmPaint) );
   }
public bool DoubleBufferingEnabled()
{
   // Get the value of the double-buffering style bits.
   return this.GetStyle(ControlStyles.DoubleBuffer | 
      ControlStyles.UserPaint | 
      ControlStyles.AllPaintingInWmPaint);
}
Public Function DoubleBufferingEnabled() As Boolean
   ' Get the value of the double-buffering style bits.
   Return Me.GetStyle((ControlStyles.DoubleBuffer _
     Or ControlStyles.UserPaint _
     Or ControlStyles.AllPaintingInWmPaint))
End Function

설명

컨트롤 스타일 비트 플래그는 지원되는 동작을 분류하는 데 사용됩니다. 컨트롤은 메서드를 호출 SetStyle 하고 적절한 ControlStyles 비트와 부울 값을 전달하여 비트를 설정하여 스타일을 사용하도록 설정할 수 있습니다. 지정된 비트에 할당된 ControlStyles 값을 확인하려면 메서드를 GetStyle 사용하고 멤버를 ControlStyles 전달하여 평가합니다.

적용 대상

추가 정보