CaptionButton Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the type of caption button to display.
public enum class CaptionButton
public enum CaptionButton
type CaptionButton =
Public Enum CaptionButton
- Inheritance
Fields
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. |
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.
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
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
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈