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.DrawCaptionButtonCaptionButton示しています。 この例を実行するには、Button1 という名前の Button を含むフォームに次のコードを貼り付けます。 フォームはシステムをインポートする必要があります。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

キャプション ボタンは、通常、フォームのタイトル バーの右端にあるシステム ボタンです。

適用対象

こちらもご覧ください