Bahasa

ControlPaint.DrawCaptionButton Metode

Definisi

Menggambar kontrol tombol keterangan.

Overload

Nama Deskripsi
DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Menggambar kontrol tombol keterangan yang ditentukan dalam status yang ditentukan, pada permukaan grafik yang ditentukan, dan dalam batas yang ditentukan.

DrawCaptionButton(Graphics, Int32, Int32, Int32, Int32, CaptionButton, ButtonState)

Menggambar kontrol tombol keterangan yang ditentukan dalam status yang ditentukan, pada permukaan grafik yang ditentukan, dan dalam batas yang ditentukan.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs

Menggambar kontrol tombol keterangan yang ditentukan dalam status yang ditentukan, pada permukaan grafik yang ditentukan, dan dalam batas yang ditentukan.

public:
 static void DrawCaptionButton(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::CaptionButton button, System::Windows::Forms::ButtonState state);
public static void DrawCaptionButton(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.CaptionButton button, System.Windows.Forms.ButtonState state);
static member DrawCaptionButton : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CaptionButton * System.Windows.Forms.ButtonState -> unit
Public Shared Sub DrawCaptionButton (graphics As Graphics, rectangle As Rectangle, button As CaptionButton, state As ButtonState)

Parameter

graphics
Graphics

Untuk Graphics menggambar.

rectangle
Rectangle

Rectangle yang mewakili dimensi tombol keterangan.

button
CaptionButton

Salah CaptionButton satu nilai yang menentukan jenis tombol keterangan untuk menggambar.

state
ButtonState

Kombinasi bitwise dari ButtonState nilai yang menentukan status untuk menggambar tombol.

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 namespace System.Windows.Forms dan System.Drawing. Pastikan peristiwa tombol Paint dikaitkan dengan penanganan aktivitas 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

Lihat juga

Berlaku untuk

DrawCaptionButton(Graphics, Int32, Int32, Int32, Int32, CaptionButton, ButtonState)

Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs
Sumber:
ControlPaint.cs

Menggambar kontrol tombol keterangan yang ditentukan dalam status yang ditentukan, pada permukaan grafik yang ditentukan, dan dalam batas yang ditentukan.

public:
 static void DrawCaptionButton(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::CaptionButton button, System::Windows::Forms::ButtonState state);
public static void DrawCaptionButton(System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.CaptionButton button, System.Windows.Forms.ButtonState state);
static member DrawCaptionButton : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.CaptionButton * System.Windows.Forms.ButtonState -> unit
Public Shared Sub DrawCaptionButton (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, button As CaptionButton, state As ButtonState)

Parameter

graphics
Graphics

Untuk Graphics menggambar.

x
Int32

Koordinat x dari kiri atas persegi panjang gambar.

y
Int32

Koordinat y dari kiri atas persegi panjang gambar.

width
Int32

Lebar persegi panjang gambar.

height
Int32

Tinggi persegi panjang gambar.

button
CaptionButton

Salah CaptionButton satu nilai yang menentukan jenis tombol keterangan untuk menggambar.

state
ButtonState

Kombinasi bitwise dari ButtonState nilai yang menentukan status untuk menggambar tombol.

Contoh

Contoh kode berikut menunjukkan penggunaan DrawCaptionButton metode dan CaptionButton enumerasi. Untuk menjalankan contoh ini, tempelkan kode berikut dalam formulir yang berisi nama ButtonButton1. Formulir harus mengimpor namespace System.Windows.Forms dan System.Drawing. Pastikan peristiwa tombol Paint dikaitkan dengan penanganan aktivitas 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

Lihat juga

Berlaku untuk