ListItem.BorderBrush プロパティ

定義

要素の境界線を描画するときに使用する Brush を取得または設定します。Gets or sets a Brush to use when painting the element's border.

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

プロパティ値

要素の境界線に適用するために使用するブラシ。The brush used to apply to the element's border. 既定値は、null です。The default is null.

要素の属性BorderBrushを設定する方法を次の例に示しParagraphます ()。 BlockThe following example shows how to set the BorderBrush attribute of a Block element (Paragraph).

<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>

この例の表示結果を次の図に示します。The following figure shows how this example renders.

スクリーン次のよう/に、ブロックScreenshot: Blue, 1/4inch border around Block

次の例では、プログラムをBorderBrush使用してプロパティを設定する方法を示します。The following example shows how to set the BorderBrush property programmatically.

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ついては、「」を参照してください。For a table of swatches that show the available predefined brush colors, see Brushes.

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field BorderBrushProperty
メタデータプロパティがに設定されるtrueMetadata properties set to true AffectsRender

適用対象

こちらもご覧ください