Form.ControlBox 속성

정의

폼의 캡션 표시줄에 컨트롤 상자가 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool ControlBox { bool get(); void set(bool value); };
public bool ControlBox { get; set; }
member this.ControlBox : bool with get, set
Public Property ControlBox As Boolean

속성 값

true 양식에 양식의 오른쪽 위 모서리에 컨트롤 상자가 표시되면 이고, 그렇지 않으면 입니다 false. 기본값은 true입니다.

예제

다음 예제에서는 , , FormBorderStyle, MaximizeBoxMinimizeBoxStartPosition 속성을 사용하여 ControlBox테두리나 캡션 상자가 없는 양식을 만듭니다. 이 예제에서 만든 양식 애플리케이션에 대 한 시작 화면을 만들려면 사용할 수 있습니다. 이 예제에서는 예제의 메서드가 양식 클래스에 정의되고 폼이 초기화될 때 호출되어야 합니다.

public:
   void CreateMyBorderlessWindow()
   {
      this->FormBorderStyle = ::FormBorderStyle::None;
      this->MaximizeBox = false;
      this->MinimizeBox = false;
      this->StartPosition = FormStartPosition::CenterScreen;
      // Remove the control box so the form will only display client area.
      this->ControlBox = false;
   }
public void CreateMyBorderlessWindow()
 {
    this.FormBorderStyle = FormBorderStyle.None;
    this.MaximizeBox = false;
    this.MinimizeBox = false;
    this.StartPosition = FormStartPosition.CenterScreen;
    // Remove the control box so the form will only display client area.
    this.ControlBox = false;
 }
Public Sub CreateMyBorderlesWindow()
    FormBorderStyle = FormBorderStyle.None
    MaximizeBox = False
    MinimizeBox = False
    StartPosition = FormStartPosition.CenterScreen
    ' Remove the control box so the form will only display client area.
    ControlBox = False
End Sub

설명

속성이 ControlBoxtrue설정된 경우 컨트롤 상자는 캡션 표시줄의 오른쪽 위 모서리에 표시됩니다. 컨트롤 상자에는 닫기 단추 외에도 최소화, 최대화 및 도움말 단추가 포함될 수 있습니다. ControlBox 속성을 적용하려면 폼의 FormBorderStyle 속성도 , , FormBorderStyle.SizableFormBorderStyle.Fixed3D또는 FormBorderStyle.FixedDialogFormBorderStyle.FixedSingle설정해야 합니다.

를 로 false 설정하고 ControlBox 속성을 Size 설정하는 Location 경우 폼의 속성이 양식의 클라이언트가 아닌 영역이 숨겨져 있음을 반영하도록 업데이트되지 않습니다. 이 문제를 해결하려면 이벤트 처리기에서 HandleCreated 속성을 변경하는 코드를 입력합니다Location.

참고

falseControlBox 설정하면 속성은 만들 때 최대화된 것으로 표시되는 MDI(다중 문서 인터페이스) 자식 양식에 영향을 주지 않습니다.

적용 대상

추가 정보