ボタン スタイル コントロールの輪郭を、指定したスタイルと色を使用して、指定した範囲内の指定したグラフィックスの表面に描画します。
Overloads Public Shared Sub DrawBorder( _
ByVal graphics As Graphics, _ ByVal bounds As Rectangle, _ ByVal color As Color, _ ByVal style As ButtonBorderStyle _)
[C#]
public static void DrawBorder(Graphicsgraphics,Rectanglebounds,Colorcolor,ButtonBorderStylestyle);
[C++]
public: static void DrawBorder(Graphics* graphics,Rectanglebounds,Colorcolor,ButtonBorderStylestyle);
[JScript]
public static function DrawBorder(
graphics : Graphics,bounds : Rectangle,color : Color,style : ButtonBorderStyle);
パラメータ
- graphics
描画する Graphics 。 - bounds
輪郭の大きさを表す Rectangle 。 - color
輪郭の Color 。 - style
境界線のスタイルを指定する ButtonBorderStyle 値の 1 つ。
使用例
[Visual Basic, C#] System.Windows.Forms.DrawBorder3D メソッドの中の 1 つを使用する方法を次のコード例に示します。この例を実行するには、次のコードをフォームに貼り付けます。このフォームは、 System.Windows.Forms 名前空間および System.Drawing 名前空間をインポートします。
' 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
[C#]
// 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);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン
をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
ControlPaint クラス | ControlPaint メンバ | System.Windows.Forms 名前空間 | ControlPaint.DrawBorder オーバーロードの一覧