ControlPaint.DrawBorder Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Gombstílusú vezérlőelem szegélyének rajzolása.
Túlterhelések
| Név | Description |
|---|---|
| DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle) |
A megadott stílussal és színnel szegélyt rajzol a megadott grafikus felületen, valamint a gombstílus-vezérlő megadott határain belül. |
| DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle) |
Szegélyt rajzol egy gombstílus-vezérlőre a megadott stílusokkal, színekkel és szegélyszélességekkel; a megadott grafikus felületen; és a megadott korlátokon belül. |
DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
A megadott stílussal és színnel szegélyt rajzol a megadott grafikus felületen, valamint a gombstílus-vezérlő megadott határain belül.
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)
Paraméterek
- style
- ButtonBorderStyle
ButtonBorderStyle A szegély stílusát meghatározó értékek egyike.
Példák
Az alábbi példakód az egyik DrawBorder3D metódus használatát mutatja be. A példa futtatásához illessze be a következő kódot a System.Windows.Forms és System.Drawing névtereket importáló űrlapba. Ebben a példában győződjön meg arról, hogy az űrlap eseménye Paint az eseménykezelőhöz van társítva.
// 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
A következőre érvényes:
DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle)
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
- Forrás:
- ControlPaint.cs
Szegélyt rajzol egy gombstílus-vezérlőre a megadott stílusokkal, színekkel és szegélyszélességekkel; a megadott grafikus felületen; és a megadott korlátokon belül.
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)
Paraméterek
- leftWidth
- Int32
A bal oldali szegély szélessége.
- leftStyle
- ButtonBorderStyle
ButtonBorderStyle A bal oldali szegély stílusát meghatározó értékek egyike.
- topWidth
- Int32
A felső szegély szélessége.
- topStyle
- ButtonBorderStyle
ButtonBorderStyle A felső szegély stílusát meghatározó értékek egyike.
- rightWidth
- Int32
A jobb oldali szegély szélessége.
- rightStyle
- ButtonBorderStyle
ButtonBorderStyle A megfelelő szegély stílusát meghatározó értékek egyike.
- bottomWidth
- Int32
Az alsó szegély szélessége.
- bottomStyle
- ButtonBorderStyle
ButtonBorderStyle Az alsó szegély stílusát meghatározó értékek egyike.
Példák
Az alábbi példakód az egyik DrawBorder3D metódus használatát mutatja be. A példa futtatásához illessze be a következő kódot a System.Windows.Forms és System.Drawing névtereket importáló űrlapba. Ebben a példában győződjön meg arról, hogy az űrlap eseménye Paint az eseménykezelőhöz van társítva.
// 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