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.DrawCaptionButton 该方法和 CaptionButton 枚举。 若要运行此示例,请将以下代码粘贴到包含名为 Button1 的按钮的窗体中。 窗体应导入系统。Windows。窗体和 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.

标题按钮是通常位于窗体标题栏最右侧的系统按钮。

适用于

另请参阅