Bahasa

CaptionButton Enum

Definisi

Menentukan tipe tombol keterangan yang akan ditampilkan.

public enum class CaptionButton
public enum CaptionButton
type CaptionButton = 
Public Enum CaptionButton
Warisan
CaptionButton

Bidang

Nama Nilai Deskripsi
Close 0

Tombol Tutup.

Minimize 1

Tombol Minimalkan.

Maximize 2

Tombol Maksimalkan.

Restore 3

Tombol Pulihkan.

Help 4

Tombol Bantuan.

Contoh

Contoh kode berikut menunjukkan penggunaan ControlPaint.DrawCaptionButton metode dan CaptionButton enumerasi. Untuk menjalankan contoh ini tempelkan kode berikut dalam formulir yang berisi Tombol bernama Button1. Formulir harus mengimpor Sistem. Windows. Namespace Layanan Formulir dan System.Drawing. Pastikan peristiwa Paint tombol dikaitkan dengan metode penanganan peristiwa dalam contoh ini.

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

Keterangan

Enumerasi ini digunakan oleh ControlPaint.DrawCaptionButton.

Tombol keterangan adalah tombol sistem yang biasanya ditemukan di sisi paling kanan bilah judul formulir.

Berlaku untuk

Lihat juga