英語で読む

次の方法で共有


CaptionButton 列挙型

定義

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

C#
public enum CaptionButton
継承
CaptionButton

フィールド

Close 0

閉じるボタン。

Help 4

[?] ボタン。

Maximize 2

最大化ボタン。

Minimize 1

最小化ボタン。

Restore 3

元のサイズに戻すボタン。

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

C#
// 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);
}

注釈

この列挙体は.ControlPaint.DrawCaptionButton

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

適用対象

製品 バージョン
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7

こちらもご覧ください