Pen.DashStyle プロパティ

定義

この Pen によって生成される破線のパターンを記述する値を取得または設定します。

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

プロパティ値

DashStyle

この Pen によって生成される破線のパターンを記述する値。 既定値は Solid で、破線にしないことを示します。

次の例は、a Pen のプロパティをDashStyle使用して、テキストの下に破線を作成する方法を示しています。

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <StackPanel Margin="20">

    <TextBlock FontSize="36">
      the lazy brown dog.
      <TextBlock.TextDecorations>
        <TextDecoration Location="Underline"  
          PenThicknessUnit="FontRecommended">
          <TextDecoration.Pen>
            <Pen Thickness="1.5" Brush="Red" >

              <!-- For the underline, create a dashed line with each
                   dash twice the thickness of the Pen and each gap 8 times
                   the thickness of the Pen. -->
              <Pen.DashStyle>
                <DashStyle Dashes="2,8"/>
              </Pen.DashStyle>
            </Pen>
          </TextDecoration.Pen>
        </TextDecoration>
      </TextBlock.TextDecorations>
    </TextBlock>
  </StackPanel>
</Page>

注釈

このクラスには DashStyles 、定義済みのダッシュ パターンのセットが用意されています。

依存プロパティ情報

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

適用対象

こちらもご覧ください