Share via


ControlPaint.DrawCaptionButton Yöntem

Tanım

bir başlık düğmesi denetimi çizer.

Aşırı Yüklemeler

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Belirtilen başlık düğme denetimini belirtilen durumda, belirtilen grafik yüzeyinde ve belirtilen sınırlar içinde çizer.

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

Belirtilen başlık düğme denetimini belirtilen durumda, belirtilen grafik yüzeyinde ve belirtilen sınırlar içinde çizer.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Belirtilen başlık düğme denetimini belirtilen durumda, belirtilen grafik yüzeyinde ve belirtilen sınırlar içinde çizer.

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)

Parametreler

graphics
Graphics

Üzerine Graphics çizecek.

rectangle
Rectangle

Rectangle başlık düğmesinin boyutlarını temsil eden.

button
CaptionButton

CaptionButton Çizecek başlık düğmesinin türünü belirten değerlerden biri.

state
ButtonState

Düğmenin ButtonState çizildiğini belirten değerlerin bit düzeyinde birleşimi.

Örnekler

Aşağıdaki kod örneği, yönteminin ControlPaint.DrawCaptionButton ve numaralandırmasının CaptionButton kullanımını gösterir. Bu örneği çalıştırmak için, aşağıdaki kodu adlı Button1düğmeyi içeren bir forma yapıştırın. Formun ve System.Drawing ad alanlarını içeri aktarması System.Windows.Forms gerekir. Düğmenin Paint olayının bu örnekteki olay işleyicisiyle ilişkilendirildiğinden emin olun.

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

Ayrıca bkz.

Şunlara uygulanır

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

Belirtilen başlık düğme denetimini belirtilen durumda, belirtilen grafik yüzeyinde ve belirtilen sınırlar içinde çizer.

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)

Parametreler

graphics
Graphics

Üzerine Graphics çizecek.

x
Int32

Çizim dikdörtgeninin sol üst köşesindeki x koordinatı.

y
Int32

Çizim dikdörtgeninin sol üst köşesindeki y koordinatı.

width
Int32

Çizim dikdörtgeninin genişliği.

height
Int32

Çizim dikdörtgeninin yüksekliği.

button
CaptionButton

CaptionButton Çizecek başlık düğmesinin türünü belirten değerlerden biri.

state
ButtonState

Düğmenin ButtonState çizildiğini belirten değerlerin bit düzeyinde birleşimi.

Örnekler

Aşağıdaki kod örneği, yönteminin DrawCaptionButton ve numaralandırmasının CaptionButton kullanımını gösterir. Bu örneği çalıştırmak için aşağıdaki kodu adlı Button1bir Button forma yapıştırın. Formun ve System.Drawing ad alanlarını içeri aktarması System.Windows.Forms gerekir. Düğmenin Paint olayının bu örnekteki olay işleyicisiyle ilişkilendirildiğinden emin olun.

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

Ayrıca bkz.

Şunlara uygulanır