AnchoredBlock.BorderBrush プロパティ

定義

要素の境界線を描画するときに使用する Brush を取得または設定します。

public:
 property System::Windows::Media::Brush ^ BorderBrush { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush BorderBrush { get; set; }
member this.BorderBrush : System.Windows.Media.Brush with get, set
Public Property BorderBrush As Brush

プロパティ値

要素の境界線に適用するために使用するブラシ。 既定値はブラシです null

次の例は、要素 (Paragraph) の属性をBorderBrush設定する方法を示しています。

<FlowDocument>
  <Paragraph Name="par"
    BorderBrush="Blue"
    BorderThickness="0.25in"
  >
    <Run>
      Child elements in this Block element (Paragraph) will be surrounded by a blue border.
    </Run>
    <LineBreak/><LineBreak/>
    <Run>
      This border will be one quarter inch thick in all directions.
    </Run>
  </Paragraph>
</FlowDocument>

この例の表示結果を次の図に示します。

スクリーンショット: 青、ブロック周囲の 1/4 インチの境界線 スクリーンショット

次の例では、BorderBrush プロパティをプログラムで設定する方法が示されています。

Paragraph par = new Paragraph();

Run run1 = new Run("Child elements in this Block element (Paragraph) will be surrounded by a blue border.");
Run run2 = new Run("This border will be one quarter inch thick in all directions.");

par.Inlines.Add(run1);
par.Inlines.Add(run2);

par.BorderBrush = Brushes.Blue;
ThicknessConverter tc = new ThicknessConverter();
par.BorderThickness = (Thickness)tc.ConvertFromString("0.25in");
Dim par As New Paragraph()

Dim run1 As New Run("Child elements in this Block element (Paragraph) will be surrounded by a blue border.")
Dim run2 As New Run("This border will be one quarter inch thick in all directions.")

par.Inlines.Add(run1)
par.Inlines.Add(run2)

par.BorderBrush = Brushes.Blue
Dim tc As New ThicknessConverter()
par.BorderThickness = CType(tc.ConvertFromString("0.25in"), Thickness)

注釈

使用可能な定義済みのブラシの色を示す見本の表については、「」を参照してください Brushes

依存プロパティ情報

識別子フィールド BorderBrushProperty
に設定されたメタデータ プロパティ true AffectsRender

適用対象

こちらもご覧ください