ControlPaint.DrawBorder Metoda

Definice

Nakreslí ohraničení ovládacího prvku ve stylu tlačítka.

Přetížení

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

Nakreslí ohraničení se zadaným stylem a barvou, na zadanou grafickou plochu a v rámci zadaných hranic na ovládací prvek styl tlačítka.

DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle)

Nakreslí ohraničení ovládacího prvku stylu tlačítka se zadanými styly, barvami a šířkami ohraničení; na určené grafické ploše; a v rámci zadaných mezí.

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

Nakreslí ohraničení se zadaným stylem a barvou, na zadanou grafickou plochu a v rámci zadaných hranic na ovládací prvek styl tlačítka.

public:
 static void DrawBorder(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle bounds, System::Drawing::Color color, System::Windows::Forms::ButtonBorderStyle style);
public static void DrawBorder (System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Drawing.Color color, System.Windows.Forms.ButtonBorderStyle style);
static member DrawBorder : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * System.Windows.Forms.ButtonBorderStyle -> unit
Public Shared Sub DrawBorder (graphics As Graphics, bounds As Rectangle, color As Color, style As ButtonBorderStyle)

Parametry

graphics
Graphics

Na Graphics které se má kreslit.

bounds
Rectangle

Představuje Rectangle rozměry ohraničení.

color
Color

Ohraničení Color .

style
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, která určuje styl ohraničení.

Příklady

Následující příklad kódu ukazuje použití jedné z DrawBorder3D metod. Chcete-li spustit tento příklad, vložte následující kód do formuláře, který importuje System.Windows.Forms obory názvů a System.Drawing . Ujistěte se, že Paint je událost formuláře přidružená k obslužné rutině události v tomto příkladu.

// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
void Form1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   Rectangle borderRectangle = this->ClientRectangle;
   borderRectangle.Inflate(  -10, -10 );
   ControlPaint::DrawBorder3D( e->Graphics, borderRectangle, Border3DStyle::Raised );
}
// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
private void Form1_Paint(object sender, PaintEventArgs e)
{

    Rectangle borderRectangle = this.ClientRectangle;
    borderRectangle.Inflate(-10, -10);
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, 
        Border3DStyle.Raised);
}
' Handle the Form's Paint event to draw a 3D three-dimensional 
' raised border just inside the border of the frame.
Private Sub Form1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles MyBase.Paint

    Dim borderRectangle As Rectangle = Me.ClientRectangle
    borderRectangle.Inflate(-10, -10)
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, _
        Border3DStyle.Raised)
End Sub

Platí pro

DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle)

Nakreslí ohraničení ovládacího prvku stylu tlačítka se zadanými styly, barvami a šířkami ohraničení; na určené grafické ploše; a v rámci zadaných mezí.

public:
 static void DrawBorder(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle bounds, System::Drawing::Color leftColor, int leftWidth, System::Windows::Forms::ButtonBorderStyle leftStyle, System::Drawing::Color topColor, int topWidth, System::Windows::Forms::ButtonBorderStyle topStyle, System::Drawing::Color rightColor, int rightWidth, System::Windows::Forms::ButtonBorderStyle rightStyle, System::Drawing::Color bottomColor, int bottomWidth, System::Windows::Forms::ButtonBorderStyle bottomStyle);
public static void DrawBorder (System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Drawing.Color leftColor, int leftWidth, System.Windows.Forms.ButtonBorderStyle leftStyle, System.Drawing.Color topColor, int topWidth, System.Windows.Forms.ButtonBorderStyle topStyle, System.Drawing.Color rightColor, int rightWidth, System.Windows.Forms.ButtonBorderStyle rightStyle, System.Drawing.Color bottomColor, int bottomWidth, System.Windows.Forms.ButtonBorderStyle bottomStyle);
static member DrawBorder : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle -> unit
Public Shared Sub DrawBorder (graphics As Graphics, bounds As Rectangle, leftColor As Color, leftWidth As Integer, leftStyle As ButtonBorderStyle, topColor As Color, topWidth As Integer, topStyle As ButtonBorderStyle, rightColor As Color, rightWidth As Integer, rightStyle As ButtonBorderStyle, bottomColor As Color, bottomWidth As Integer, bottomStyle As ButtonBorderStyle)

Parametry

graphics
Graphics

Na Graphics které se má kreslit.

bounds
Rectangle

Představuje Rectangle rozměry ohraničení.

leftColor
Color

Levá Color část ohraničení.

leftWidth
Int32

Šířka levého ohraničení

leftStyle
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, která určuje styl levého ohraničení.

topColor
Color

Horní Color část ohraničení.

topWidth
Int32

Šířka horního ohraničení

topStyle
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, která určuje styl horního ohraničení.

rightColor
Color

Napravo Color od ohraničení.

rightWidth
Int32

Šířka pravého ohraničení

rightStyle
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, která určuje styl pravého ohraničení.

bottomColor
Color

Dolní Color část ohraničení.

bottomWidth
Int32

Šířka dolního okraje

bottomStyle
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, která určuje styl dolního okraje.

Příklady

Následující příklad kódu ukazuje použití jedné z DrawBorder3D metod. Chcete-li spustit tento příklad, vložte následující kód do formuláře, který importuje System.Windows.Forms obory názvů a System.Drawing . Ujistěte se, že Paint je událost formuláře přidružená k obslužné rutině události v tomto příkladu.

// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
void Form1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   Rectangle borderRectangle = this->ClientRectangle;
   borderRectangle.Inflate(  -10, -10 );
   ControlPaint::DrawBorder3D( e->Graphics, borderRectangle, Border3DStyle::Raised );
}
// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
private void Form1_Paint(object sender, PaintEventArgs e)
{

    Rectangle borderRectangle = this.ClientRectangle;
    borderRectangle.Inflate(-10, -10);
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, 
        Border3DStyle.Raised);
}
' Handle the Form's Paint event to draw a 3D three-dimensional 
' raised border just inside the border of the frame.
Private Sub Form1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles MyBase.Paint

    Dim borderRectangle As Rectangle = Me.ClientRectangle
    borderRectangle.Inflate(-10, -10)
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, _
        Border3DStyle.Raised)
End Sub

Viz také

Platí pro