ControlPaint.DrawBorder Metoda

Definice

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

Přetížení

Name Description
DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

Nakreslí ohraničení se zadaným stylem a barvou na zadané grafické ploše a v rámci zadaných hranic ovládacího prvku stylu 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 zadané grafické ploše; a v rámci zadaných mezí.

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

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

Nakreslí ohraničení se zadaným stylem a barvou na zadané grafické ploše a v rámci zadaných hranic ovládacího prvku stylu 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

Nakreslit Graphics .

bounds
Rectangle

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

color
Color

Hranice Color .

style
ButtonBorderStyle

Jedna z ButtonBorderStyle hodnot, které určují styl ohraničení.

Příklady

Následující příklad kódu ukazuje použití jedné z DrawBorder3D metod. Pokud chcete tento příklad spustit, vložte následující kód do formuláře, který importuje obory názvů System.Windows.Forms a System.Drawing. Ujistěte se, že je událost formuláře Paint 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)

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

Nakreslí ohraničení ovládacího prvku stylu tlačítka se zadanými styly, barvami a šířkami ohraničení; na zadané 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

Nakreslit Graphics .

bounds
Rectangle

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

leftColor
Color

Nalevo Color od okraje.

leftWidth
Int32

Šířka levého okraje.

leftStyle
ButtonBorderStyle

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

topColor
Color

Horní Color okraj 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 okraj ohraničení.

bottomWidth
Int32

Šířka dolního okraje.

bottomStyle
ButtonBorderStyle

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

Příklady

Následující příklad kódu ukazuje použití jedné z DrawBorder3D metod. Pokud chcete tento příklad spustit, vložte následující kód do formuláře, který importuje obory názvů System.Windows.Forms a System.Drawing. Ujistěte se, že je událost formuláře Paint 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