次の方法で共有


Shape.BorderColor プロパティ

図形の境界線の色または線コントロールを取得または設定します。

名前空間:  Microsoft.VisualBasic.PowerPacks
アセンブリ:  Microsoft.VisualBasic.PowerPacks.Vs (Microsoft.VisualBasic.PowerPacks.Vs.dll 内)

構文

'宣言
<BrowsableAttribute(True)> _
Public Property BorderColor As Color
[BrowsableAttribute(true)]
public Color BorderColor { get; set; }
[BrowsableAttribute(true)]
public:
property Color BorderColor {
    Color get ();
    void set (Color value);
}
[<BrowsableAttribute(true)>]
member BorderColor : Color with get, set
function get BorderColor () : Color
function set BorderColor (value : Color)

プロパティ値

型 : System.Drawing.Color
図形または行の境界線の色を表す Color の構造体。既定値は、DefaultBorderColor の値です。

解説

LineShape コントロールの場合、BorderColor は線の色を表します。

OvalShape または RectangleShape コントロールの場合、BorderColor は、図形の外側の色を表します。

次の例に OvalShape のコントロールの BorderColor、BorderStyle と 3 ピクセルの表示幅 BorderWidth のプロパティを設定する方法を赤によって点を打たれる境界を持つ楕円を示します。

Dim OvalShape1 As New OvalShape
Dim canvas As New ShapeContainer
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' Set the ShapeContainer as the parent of the OvalShape.
OvalShape1.Parent = canvas
' Change the color of the border to red.
OvalShape1.BorderColor = Color.Red
' Change the style of the border to dotted.
OvalShape1.BorderStyle = Drawing2D.DashStyle.Dot
' Change the thickness of the border to 3 pixels.
OvalShape1.BorderWidth = 3
OvalShape1.Size = New Size(300, 200)
OvalShape ovalShape1 = new OvalShape();
ShapeContainer canvas = new ShapeContainer();
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the OvalShape.
ovalShape1.Parent = canvas;
// Change the color of the border to red.
ovalShape1.BorderColor = Color.Red;
// Change the style of the border to dotted.
ovalShape1.BorderStyle = System.Drawing.Drawing2D.DashStyle.Dot;
// Change the thickness of the border to 3 pixels.
ovalShape1.BorderWidth = 3;
ovalShape1.Size = new Size(300, 200);

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

Shape クラス

Microsoft.VisualBasic.PowerPacks 名前空間

その他の技術情報

方法 : LineShape コントロールを使用して線を描画する (Visual Studio)

方法 : OvalShape コントロールおよび RectangleShape コントロールを使用して図形を描画する (Visual Studio)

ライン コントロールとシェイプ コントロールの概要 (Visual Studio)