CaptionButton 列挙型

定義

表示するキャプション ボタンの種類を指定します。

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

フィールド

名前 説明
Close 0

閉じるボタン。

Minimize 1

最小化ボタン。

Maximize 2

最大化ボタン。

Restore 3

[復元] ボタン。

Help 4

[ヘルプ] ボタン。

次のコード例では、 ControlPaint.DrawCaptionButton メソッドと CaptionButton 列挙体の使用を示します。 この例を実行するには、Button1 という名前の Button を含むフォームに次のコードを貼り付けます。 フォームはシステムをインポートする必要があります。Windows。Forms 名前空間と System.Drawing 名前空間。 この例では、ボタンの Paint イベントがイベント処理メソッドに関連付けられていることを確認します。

// 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によって使用されます。

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

適用対象

こちらもご覧ください