ControlPaint.DrawCaptionButton Metoda

Definicja

Rysuje kontrolkę przycisku podpis.

Przeciążenia

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Rysuje określoną kontrolkę przycisku podpis w określonym stanie, na określonej powierzchni grafiki i w określonych granicach.

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

Rysuje określoną kontrolkę przycisku podpis w określonym stanie, na określonej powierzchni grafiki i w określonych granicach.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Rysuje określoną kontrolkę przycisku podpis w określonym stanie, na określonej powierzchni grafiki i w określonych granicach.

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)

Parametry

graphics
Graphics

Narysować Graphics .

rectangle
Rectangle

Obiekt Rectangle reprezentujący wymiary przycisku podpis.

button
CaptionButton

CaptionButton Jedna z wartości określających typ przycisku podpis do rysowania.

state
ButtonState

Bitowa kombinacja ButtonState wartości, które określają stan do narysowania przycisku.

Przykłady

W poniższym przykładzie kodu pokazano użycie ControlPaint.DrawCaptionButton metody i CaptionButton wyliczenia. Aby uruchomić ten przykład, wklej następujący kod w formularzu zawierającym przycisk o nazwie Button1. Formularz powinien importować System.Windows.Forms przestrzenie nazw i System.Drawing . Upewnij się, że zdarzenie przycisku Paint jest skojarzone z procedurą obsługi zdarzeń w tym przykładzie.

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

Zobacz też

Dotyczy

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

Rysuje określoną kontrolkę przycisku podpis w określonym stanie, na określonej powierzchni grafiki i w określonych granicach.

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)

Parametry

graphics
Graphics

Narysować Graphics .

x
Int32

Współrzędna x lewej górnej części prostokąta rysunku.

y
Int32

Współrzędna y lewego górnego prostokąta rysunku.

width
Int32

Szerokość prostokąta rysunku.

height
Int32

Wysokość prostokąta rysunku.

button
CaptionButton

CaptionButton Jedna z wartości określających typ przycisku podpis do rysowania.

state
ButtonState

Bitowa kombinacja ButtonState wartości, które określają stan do narysowania przycisku.

Przykłady

W poniższym przykładzie kodu pokazano użycie DrawCaptionButton metody i CaptionButton wyliczenia. Aby uruchomić ten przykład, wklej następujący kod w formularzu zawierającym Button nazwę Button1. Formularz powinien importować System.Windows.Forms przestrzenie nazw i System.Drawing . Upewnij się, że zdarzenie przycisku Paint jest skojarzone z procedurą obsługi zdarzeń w tym przykładzie.

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

Zobacz też

Dotyczy