ControlPaint.DrawCaptionButton Metoda

Definice

Nakreslí ovládací prvek tlačítka titulku.

Přetížení

Name Description
DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Nakreslí zadaný ovládací prvek tlačítka titulku v zadaném stavu, na zadané grafické ploše a v zadaných mezích.

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

Nakreslí zadaný ovládací prvek tlačítka titulku v zadaném stavu, na zadané grafické ploše a v zadaných mezích.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs

Nakreslí zadaný ovládací prvek tlačítka titulku v zadaném stavu, na zadané grafické ploše a v zadaných mezích.

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

Nakreslit Graphics .

rectangle
Rectangle

Představuje Rectangle rozměry tlačítka titulku.

button
CaptionButton

Jedna z CaptionButton hodnot, která určuje typ tlačítka titulku, který se má nakreslit.

state
ButtonState

Bitové kombinace ButtonState hodnot, které určují stav, do kterého se má tlačítko nakreslit.

Příklady

Následující příklad kódu ukazuje použití ControlPaint.DrawCaptionButton metody a výčtu CaptionButton . Chcete-li spustit tento příklad, vložte následující kód do formuláře obsahující tlačítko s názvem Button1. Formulář by měl importovat obory názvů System.Windows.Forms a System.Drawing. Ujistěte se, že je událost tlačítka Paint přidružená k obslužné rutině události v tomto příkladu.

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

Viz také

Platí pro

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

Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs
Zdroj:
ControlPaint.cs

Nakreslí zadaný ovládací prvek tlačítka titulku v zadaném stavu, na zadané grafické ploše a v zadaných mezích.

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

Nakreslit Graphics .

x
Int32

Souřadnice x levého horního rohu obdélníku výkresu.

y
Int32

Souřadnice y v levém horním rohu obdélníku výkresu.

width
Int32

Šířka obdélníku výkresu.

height
Int32

Výška obdélníku výkresu.

button
CaptionButton

Jedna z CaptionButton hodnot, která určuje typ tlačítka titulku, který se má nakreslit.

state
ButtonState

Bitové kombinace ButtonState hodnot, které určují stav, do kterého se má tlačítko nakreslit.

Příklady

Následující příklad kódu ukazuje použití DrawCaptionButton metody a výčtu CaptionButton . Chcete-li spustit tento příklad, vložte následující kód do formuláře obsahujícího pojmenovaný ButtonButton1. Formulář by měl importovat obory názvů System.Windows.Forms a System.Drawing. Ujistěte se, že je událost tlačítka Paint přidružená k obslužné rutině události v tomto příkladu.

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

Viz také

Platí pro