Nyelv

ControlPaint.DrawCaptionButton Metódus

Definíció

Felirat gomb vezérlőelem rajzolása.

Túlterhelések

Név Description
DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Megrajzolja a megadott feliratgomb vezérlőelemet a megadott állapotban, a megadott grafikus felületen és a megadott korlátokon belül.

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

Megrajzolja a megadott feliratgomb vezérlőelemet a megadott állapotban, a megadott grafikus felületen és a megadott korlátokon belül.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs

Megrajzolja a megadott feliratgomb vezérlőelemet a megadott állapotban, a megadott grafikus felületen és a megadott korlátokon belül.

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)

Paraméterek

graphics
Graphics

A Graphics rajzolás.

rectangle
Rectangle

A Rectangle felirat gomb méreteit jelképező érték.

button
CaptionButton

Az egyik CaptionButton érték, amely megadja a rajzolni kívánt felirat gomb típusát.

state
ButtonState

A gomb behúzásához ButtonState az állapotot meghatározó értékek bitenkénti kombinációja.

Példák

Az alábbi példakód a metódus és az ControlPaint.DrawCaptionButtonCaptionButton enumerálás használatát mutatja be. A példa futtatásához illessze be a következő kódot egy gombot Button1tartalmazó űrlapba. Az űrlapnak importálnia kell a System.Windows.Forms és System.Drawing névtereket. Ebben a példában győződjön meg arról, hogy a gomb eseménye Paint az eseménykezelőhöz van társítva.

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

Lásd még

A következőre érvényes:

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

Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs

Megrajzolja a megadott feliratgomb vezérlőelemet a megadott állapotban, a megadott grafikus felületen és a megadott korlátokon belül.

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)

Paraméterek

graphics
Graphics

A Graphics rajzolás.

x
Int32

A rajz téglalap bal felső részének x koordinátája.

y
Int32

A rajz téglalap bal felső részének y koordinátája.

width
Int32

A rajz téglalap szélessége.

height
Int32

A rajz téglalap magassága.

button
CaptionButton

Az egyik CaptionButton érték, amely megadja a rajzolni kívánt felirat gomb típusát.

state
ButtonState

A gomb behúzásához ButtonState az állapotot meghatározó értékek bitenkénti kombinációja.

Példák

Az alábbi példakód a metódus és az DrawCaptionButtonCaptionButton enumerálás használatát mutatja be. A példa futtatásához illessze be a következő kódot egy Button elnevezett Button1kódot tartalmazó űrlapba. Az űrlapnak importálnia kell a System.Windows.Forms és System.Drawing névtereket. Ebben a példában győződjön meg arról, hogy a gomb eseménye Paint az eseménykezelőhöz van társítva.

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

Lásd még

A következőre érvényes: