Freigeben über


CaptionButton-Enumeration

Gibt den Typ der anzuzeigenden Titelleistenschaltfläche an.

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

Syntax

'Declaration
Public Enumeration CaptionButton
'Usage
Dim instance As CaptionButton
public enum CaptionButton
public enum class CaptionButton
public enum CaptionButton
public enum CaptionButton

Member

  Membername Beschreibung
Close Schaltfläche Schließen. 
Help Schaltfläche Hilfe. 
Maximize Schaltfläche Maximieren. 
Minimize Schaltfläche Minimieren. 
Restore Schaltfläche Wiederherstellen. 

Hinweise

Diese Enumeration wird von ControlPaint.DrawCaptionButton verwendet.

Bei Titelleistenschaltflächen handelt es sich um die Systemschaltflächen, die sich normalerweise ganz rechts auf der Titelleiste eines Formulars befinden.

Beispiel

Im folgenden Codebeispiel wird die Verwendung der ControlPaint.DrawCaptionButton-Enumeration und der CaptionButton-Methode veranschaulicht. Fügen Sie zum Ausführen dieses Beispiels folgenden Code in ein Formular ein, das einen Button namens Button1 enthält. In das Formular müssen der System.Windows.Forms-Namespace und der System.Drawing-Namespace importiert werden. Stellen Sie sicher, dass das Paint-Ereignis der Schaltfläche der Ereignisbehandlungsmethode in diesem Beispiel zugeordnet ist.

' Handle the Button1 object's Paint Event to create a CaptionButton.
Private Sub Button1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles Button1.Paint

    ' Draw a CaptionButton control using the ClientRectangle 
    ' property of Button1. Make the button a Help button 
    ' with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle, _
        CaptionButton.Help, ButtonState.Normal)
End Sub
// Handle the Button1 object's Paint Event to create a CaptionButton.
private void Button1_Paint(object sender, PaintEventArgs e)
{

    // Draw a CaptionButton control using the ClientRectangle 
    // property of Button1. Make the button a Help button 
    // with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle,
        CaptionButton.Help, ButtonState.Normal);
}
// Handle the Button1 object's Paint Event to create a CaptionButton.
void Button1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   
   // Draw a CaptionButton control using the ClientRectangle 
   // property of Button1. Make the button a Help button 
   // with a normal state.
   ControlPaint::DrawCaptionButton( e->Graphics, Button1->ClientRectangle, CaptionButton::Help, ButtonState::Normal );
}
// Handle the button1 object's Paint Event to create a CaptionButton.
private void button1_Paint(Object sender, PaintEventArgs e)
{
    // Draw a CaptionButton control using the ClientRectangle 
    // property of button1. Make the button a Help button 
    // with a normal state.
    ControlPaint.DrawCaptionButton(e.get_Graphics(), 
        button1.get_ClientRectangle(), CaptionButton.Help, 
        ButtonState.Normal);
} //button1_Paint

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, 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

Siehe auch

Referenz

System.Windows.Forms-Namespace
DrawCaptionButton