ControlPaint.DrawBorder Metoda

Definicja

Rysuje obramowanie kontrolki w stylu przycisku.

Przeciążenia

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

Rysuje obramowanie z określonym stylem i kolorem na określonej powierzchni grafiki oraz w określonych granicach kontrolki w stylu przycisku.

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

Rysuje obramowanie kontrolki w stylu przycisku z określonymi stylami, kolorami i szerokościami obramowania; na określonej powierzchni grafiki; i w określonych granicach.

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

Rysuje obramowanie z określonym stylem i kolorem na określonej powierzchni grafiki oraz w określonych granicach kontrolki w stylu przycisku.

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

Narysować Graphics .

bounds
Rectangle

Element Rectangle reprezentujący wymiary obramowania.

color
Color

Granica Color .

style
ButtonBorderStyle

ButtonBorderStyle Jedna z wartości określających styl obramowania.

Przykłady

Poniższy przykład kodu przedstawia użycie jednej z DrawBorder3D metod. Aby uruchomić ten przykład, wklej następujący kod w formularzu, który importuje System.Windows.Forms przestrzenie nazw i System.Drawing . Upewnij się, że zdarzenie formularza Paint jest skojarzone z procedurą obsługi zdarzeń w tym przykładzie.

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

Dotyczy

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

Rysuje obramowanie kontrolki w stylu przycisku z określonymi stylami, kolorami i szerokościami obramowania; na określonej powierzchni grafiki; i w określonych granicach.

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

Narysować Graphics .

bounds
Rectangle

Element Rectangle reprezentujący wymiary obramowania.

leftColor
Color

Lewa Color krawędź.

leftWidth
Int32

Szerokość lewego obramowania.

leftStyle
ButtonBorderStyle

ButtonBorderStyle Jedna z wartości określających styl lewego obramowania.

topColor
Color

Górna Color część obramowania.

topWidth
Int32

Szerokość górnej obramowania.

topStyle
ButtonBorderStyle

ButtonBorderStyle Jedna z wartości określających styl górnej obramowania.

rightColor
Color

Z Color prawej strony obramowania.

rightWidth
Int32

Szerokość prawego obramowania.

rightStyle
ButtonBorderStyle

ButtonBorderStyle Jedna z wartości określających styl prawej obramowania.

bottomColor
Color

U Color dołu obramowania.

bottomWidth
Int32

Szerokość obramowania dolnego.

bottomStyle
ButtonBorderStyle

Jedna z ButtonBorderStyle wartości określających styl obramowania dolnego.

Przykłady

Poniższy przykład kodu przedstawia użycie jednej z DrawBorder3D metod. Aby uruchomić ten przykład, wklej następujący kod w formularzu, który importuje System.Windows.Forms przestrzenie nazw i System.Drawing . Upewnij się, że zdarzenie formularza Paint jest skojarzone z procedurą obsługi zdarzeń w tym przykładzie.

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

Zobacz też

Dotyczy