Pen.DashStyle Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that describes the pattern of dashes generated by this 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
Property Value
A value that describes the pattern of dashes generated by this Pen. The default is Solid, which indicates that there should be no dashes.
Examples
The following example shows how to use the DashStyle property of a Pen to create a dashed line under text.
<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>
Remarks
The DashStyles class provides a set of predefined dash patterns.
Dependency Property Information
Identifier field | DashStyleProperty |
Metadata properties set to true |
None |
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기