CaptionButton 列挙型
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
表示するキャプション ボタンの種類を指定します。
public enum class CaptionButton
C#
public enum CaptionButton
type CaptionButton =
Public Enum 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 );
}
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);
}
' 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
キャプション ボタンは、通常、フォームのタイトル バーの右端にあるシステム ボタンです。
製品 | バージョン |
---|---|
.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 |