CaptionButton 列舉

定義

指定要顯示的標題按鈕類型。

public enum class CaptionButton
public enum CaptionButton
type CaptionButton = 
Public Enum CaptionButton
繼承
CaptionButton

欄位

Close 0

[關閉] 按鈕。

Help 4

[說明] 按鈕。

Maximize 2

[最大化] 按鈕。

Minimize 1

[最小化] 按鈕。

Restore 3

[還原] 按鈕。

範例

下列程式碼範例示範如何使用 ControlPaint.DrawCaptionButton 方法和 CaptionButton 列舉。 若要執行此範例,請將下列程式碼貼到包含 Button1 按鈕的表單中。 表單應該匯入 System。Windows。Forms 和 System.Drawing 命名空間。 請確定按鈕的小畫家事件與此範例中的事件處理方法相關聯。

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

備註

這個列舉是由 ControlPaint.DrawCaptionButton 使用。

標題按鈕是通常位於表單標題列最右側的系統按鈕。

適用於

另請參閱