CaptionButton 列舉

定義

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

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

欄位

名稱 Description
Close 0

一個關閉按鈕。

Minimize 1

一個最小化按鈕。

Maximize 2

一個最大化按鈕。

Restore 3

一個還原按鈕。

Help 4

一個幫助按鈕。

範例

以下程式碼範例示範 ControlPaint.DrawCaptionButton 如何使用方法與 CaptionButton 列舉。 執行此範例時,將以下程式碼貼入包含名為 Button1 的表單。 表單應該會匯入系統。Windows。形式與系統。繪製命名空間。 在此範例中,請確保按鈕的繪圖事件與事件處理方法相關聯。

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

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

適用於

另請參閱