다음을 통해 공유


Form.ControlBox 속성

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

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

구문

‘선언
Public Property ControlBox As Boolean
‘사용 방법
Dim instance As Form
Dim value As Boolean

value = instance.ControlBox

instance.ControlBox = value
public bool ControlBox { get; set; }
public:
property bool ControlBox {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_ControlBox ()

/** @property */
public void set_ControlBox (boolean value)
public function get ControlBox () : boolean

public function set ControlBox (value : boolean)

속성 값

폼의 왼쪽 위 모퉁이에 컨트롤 상자가 표시되는 경우 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

설명

ControlBox 속성이 true로 설정되면 캡션 표시줄의 왼쪽 위 모퉁이에 컨트롤 상자가 표시됩니다. 컨트롤 상자를 클릭하면 시스템 메뉴에 액세스할 수 있습니다.

참고

false로 설정되면 ControlBox 속성은 만들어질 때 최대 크기로 표시되는 MDI(다중 문서 인터페이스) 자식 폼에 영향을 주지 않습니다.

예제

다음 코드 예제에서는 ControlBox, FormBorderStyle, MaximizeBox, MinimizeBoxStartPosition 속성을 사용하여 테두리나 캡션 상자가 없는 폼을 만듭니다. 이 예제에서 만든 폼을 사용하여 응용 프로그램의 시작 화면을 만들 수 있습니다. 이 예제를 실행하려면 메서드가 폼 클래스에 정의되어 있고 폼이 초기화될 때 호출되어야 합니다.

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 'CreateMyBorderlesWindow
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 void CreateMyBorderlessWindow()
{
    this.set_FormBorderStyle(get_FormBorderStyle().None);
    this.set_MaximizeBox(false);
    this.set_MinimizeBox(false);
    this.set_StartPosition(FormStartPosition.CenterScreen);

    // Remove the control box so the form will only display client area.
    this.set_ControlBox(false);
} //CreateMyBorderlessWindow

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, 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에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Form 클래스
Form 멤버
System.Windows.Forms 네임스페이스
MaximizeBox
MinimizeBox
ShowIcon
FormBorderStyle
WindowState