CaptionButton Výčet

Definice

Určuje typ tlačítka titulku, který se má zobrazit.

public enum class CaptionButton
public enum CaptionButton
type CaptionButton = 
Public Enum CaptionButton
Dědičnost
CaptionButton

Pole

Close 0

Tlačítko Zavřít

Help 4

Tlačítko Nápověda

Maximize 2

Tlačítko Maximalizovat

Minimize 1

Tlačítko Minimalizovat

Restore 3

Tlačítko Obnovit

Příklady

Následující příklad kódu ukazuje použití ControlPaint.DrawCaptionButton metody a výčtu CaptionButton . Chcete-li spustit tento příklad, vložte následující kód do formuláře obsahující tlačítko s názvem Button1. Formulář by měl importovat systém. Windows. Obory názvů Forms a System.Drawing Ujistěte se, že událost Malování tlačítka je přidružená k metodě zpracování událostí v tomto příkladu.

// 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

Poznámky

Tento výčet používá ControlPaint.DrawCaptionButton.

Tlačítka titulků jsou systémová tlačítka obvykle na pravé straně záhlaví formuláře.

Platí pro

Viz také