CaptionButton Enum

Definition

Specifies the type of caption button to display.

public enum CaptionButton
Inheritance
CaptionButton

Fields

Name Value Description
Close 0

A Close button.

Minimize 1

A Minimize button.

Maximize 2

A Maximize button.

Restore 3

A Restore button.

Help 4

A Help button.

Examples

The following code example demonstrates the use the ControlPaint.DrawCaptionButton method and the CaptionButton enumeration. To run this example paste the following code in a form containing a Button named Button1. The form should import the System.Windows.Forms and System.Drawing namespaces. 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.
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);
}

Remarks

This enumeration is used by ControlPaint.DrawCaptionButton.

Caption buttons are the system buttons usually found on the rightmost side of a form's title bar.

Applies to

Product Versions
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also