CaptionButton 枚举

定义

指定要显示的标题按钮的类型。Specifies the type of caption button to display.

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

字段

Close 0

“关闭”按钮。A Close button.

Help 4

“帮助”按钮。A Help button.

Maximize 2

“最大化”按钮。A Maximize button.

Minimize 1

“最小化”按钮。A Minimize button.

Restore 3

“还原”按钮。A Restore button.

示例

下面的代码示例演示如何使用ControlPaint.DrawCaptionButton方法CaptionButton和枚举。The following code example demonstrates the use the ControlPaint.DrawCaptionButton method and the CaptionButton enumeration. 若要运行此示例, 请将以下代码粘贴到包含名为 Button1 的按钮的窗体中。To run this example paste the following code in a form containing a Button named Button1. 窗体应导入 System.web 命名空间和 System.web 命名空间。The form should import the System.Windows.Forms and System.Drawing namespaces. 请确保按钮的 Paint 事件与此示例中的事件处理方法相关联。Ensure the button's Paint event is associated with the event-handling method in this example.

// 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.DrawCaptionButtonThis enumeration is used by ControlPaint.DrawCaptionButton.

标题按钮通常位于窗体标题栏的最右侧。Caption buttons are the system buttons usually found on the rightmost side of a form's title bar.

适用于

另请参阅