CaptionButton Перечисление

Определение

Указывает тип отображаемой кнопки заголовка.

public enum class CaptionButton
public enum CaptionButton
type CaptionButton = 
Public Enum CaptionButton
Наследование
CaptionButton

Поля

Имя Значение Описание
Close 0

Кнопка "Закрыть".

Minimize 1

Кнопка "Свернуть".

Maximize 2

Кнопка "Развернуть".

Restore 3

Кнопка "Восстановить".

Help 4

Кнопка справки.

Примеры

В следующем примере кода демонстрируется использование ControlPaint.DrawCaptionButton метода и CaptionButton перечисления. Чтобы запустить этот пример, вставьте следующий код в форму, содержащую кнопку с именем Button1. Форма должна импортировать систему. Windows. Формы и пространства имен System.Drawing. Убедитесь, что событие Paint кнопки связано с методом обработки событий в этом примере.

// 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

Комментарии

Это перечисление используется ControlPaint.DrawCaptionButton.

Кнопки заголовка — это системные кнопки, которые обычно находятся в правой части заголовка формы.

Применяется к

См. также раздел