CaptionButton Enumeration

Definition

Gibt den Typ der anzuzeigenden Titelleistenschaltfläche an.

public enum class CaptionButton
public enum CaptionButton
type CaptionButton = 
Public Enum CaptionButton
Vererbung
CaptionButton

Felder

Close 0

Schaltfläche Schließen

Help 4

Schaltfläche Hilfe.

Maximize 2

Schaltfläche Maximieren.

Minimize 1

Schaltfläche Minimieren.

Restore 3

Schaltfläche Wiederherstellen.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der ControlPaint.DrawCaptionButton Methode und der CaptionButton Enumeration veranschaulicht. Um dieses Beispiel auszuführen, fügen Sie den folgenden Code in ein Formular ein, das eine Schaltfläche namens "Button1" enthält. Das Formular sollte das System importieren. Windows. Formular- und System.Drawing-Namespaces. 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.
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.Graphics, Button1.ClientRectangle,
        CaptionButton.Help, ButtonState.Normal);
}
' 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

Hinweise

Diese Aufzählung wird von ControlPaint.DrawCaptionButton.

Beschriftungsschaltflächen sind die Systemschaltflächen, die normalerweise auf der rechten Seite der Titelleiste eines Formulars gefunden werden.

Gilt für

Siehe auch