ControlPaint.DrawCaptionButton Metoda

Definice

Nakreslí ovládací prvek tlačítko popis.

Přetížení

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Nakreslí zadaný ovládací prvek tlačítka popis v zadaném stavu, na zadanou grafickou plochu a v zadaných mezích.

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

Nakreslí zadaný ovládací prvek tlačítka popis v zadaném stavu, na zadanou grafickou plochu a v zadaných mezích.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

Nakreslí zadaný ovládací prvek tlačítka popis v zadaném stavu, na zadanou grafickou plochu 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

Graphics se kreslit.

rectangle
Rectangle

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

button
CaptionButton

Jedna z CaptionButton hodnot, která určuje typ tlačítka popis, které chcete nakreslit.

state
ButtonState

Bitová kombinace ButtonState hodnot, která určuje 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 . Pokud chcete spustit tento příklad, vložte následující kód do formuláře obsahujícího tlačítko s názvem Button1. Formulář by měl importovat obory System.Windows.Forms názvů a System.Drawing . Ujistěte se, že Paint je událost tlačítka 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)

Nakreslí zadaný ovládací prvek tlačítka popis v zadaném stavu, na zadanou grafickou plochu 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

Graphics se kreslit.

x
Int32

Souřadnice x v levém horním 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 nakresleného obdélníku

button
CaptionButton

Jedna z CaptionButton hodnot, která určuje typ tlačítka popis, které chcete nakreslit.

state
ButtonState

Bitová kombinace ButtonState hodnot, která určuje 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ý Button .Button1 Formulář by měl importovat obory System.Windows.Forms názvů a System.Drawing . Ujistěte se, že Paint je událost tlačítka 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