Freigeben über


Form.ControlBox-Eigenschaft

Ruft einen Wert ab, der angibt, ob auf der Titelleiste des Formulars ein Systemmenüfeld angezeigt wird, oder legt diesen fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Property ControlBox As Boolean
'Usage
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)

Eigenschaftenwert

true, wenn im Formular in der linken oberen Ecke ein Systemmenüfeld angezeigt wird, andernfalls false. Der Standardwert ist true.

Hinweise

Wenn die ControlBox-Eigenschaft auf true festgelegt ist, wird das Systemmenüfeld in der linken oberen Ecke der Titelleiste angezeigt. Durch Klicken auf das Systemmenüfeld greift der Benutzer auf das Systemmenü zu.

Hinweis

Wenn für die ControlBox-Eigenschaft false festgelegt wurde, hat diese keine Auswirkungen auf ein untergeordnetes MDI (Multiple Document Interface)-Formular, das zum Erstellungszeitpunkt maximiert angezeigt wird.

Beispiel

Im folgenden Codebeispiel wird mit den Eigenschaften ControlBox, FormBorderStyle, MaximizeBox, MinimizeBox und StartPosition ein Formular erstellt, das keinen Rahmen und kein Systemmenüfeld enthält. Das in diesem Beispiel erstellte Formular könnte als Begrüßungsbildschirm verwendet werden. Für dieses Beispiel ist es erforderlich, dass die Beispielmethode in einer Formularklasse definiert ist und bei der Initialisierung des Formulars aufgerufen wird.

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

Plattformen

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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

Form-Klasse
Form-Member
System.Windows.Forms-Namespace
MaximizeBox
MinimizeBox
ShowIcon
FormBorderStyle
WindowState