CaptionButton Enumeration
.NET Framework (current version)
Specifies the type of caption button to display.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
| Member name | Description | |
|---|---|---|
| Close | A Close button. | |
| Help | A Help button. | |
| Maximize | A Maximize button. | |
| Minimize | A Minimize button. | |
| Restore | A Restore button. |
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.
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. 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 ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: