CaptionButton 枚举

定义

指定要显示的标题按钮的类型。

C#
public enum CaptionButton
继承
CaptionButton

字段

Close 0

“关闭”按钮。

Help 4

“帮助”按钮。

Maximize 2

“最大化”按钮。

Minimize 1

“最小化”按钮。

Restore 3

“还原”按钮。

示例

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

另请参阅