Remarks

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

Members

Member name

Description

Close

A Close button.

Help

A Help button.

Maximize

A Maximize button.

Minimize

A Minimize button.

Restore

A Restore button.

Example

[Visual Basic, C#] The following code example demonstrates the use the CaptionButton enumeration. To run this example paste the following code in a form containing a Button named Button1 and associate the event-handling method contained in the example with the button's paint event. The form should import the System.Windows.Forms and System.Drawing namespaces.

[Visual Basic]
' 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
[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);
}

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button in the upper-left corner of the page.