次の方法で共有


ControlPaint.DrawBorder3D メソッド (Graphics, Rectangle, Border3DStyle)

コントロールの 3D スタイルの輪郭を、指定したスタイルを使用して、指定した範囲内の指定したグラフィックスの表面に描画します。

Overloads Public Shared Sub DrawBorder3D( _
   ByVal graphics As Graphics, _   ByVal rectangle As Rectangle, _   ByVal style As Border3DStyle _)
[C#]
public static void DrawBorder3D(Graphicsgraphics,Rectanglerectangle,Border3DStylestyle);
[C++]
public: static void DrawBorder3D(Graphics* graphics,Rectanglerectangle,Border3DStylestyle);
[JScript]
public static function DrawBorder3D(
   graphics : Graphics,rectangle : Rectangle,style : Border3DStyle);

パラメータ

  • graphics
    描画する Graphics
  • rectangle
    輪郭の大きさを表す Rectangle
  • style
    境界線のスタイルを指定する Border3DStyle 値の 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.DrawBorder3D オーバーロードの一覧 | Rectangle | Border3DStyle