如何制作带有虚线边框的richtextbox
我试过这样的事情:
<Border Width="100" Height="100" Background="White" BorderThickness="1,1,1,1">
<RichTextBox Name="richTextBox1" />
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,.1" SpreadMethod="Repeat" >
<GradientStopCollection>
<GradientStop Color="Transparent" Offset="0" />
<GradientStop Color="Transparent" Offset="0.2" />
<GradientStop Color="Red" Offset="0.2" />
<GradientStop Color="Red" Offset="0.4" />
<GradientStop Color="Transparent" Offset="0.4" />
<GradientStop Color="Transparent" Offset="0.6" />
<GradientStop Color="Red" Offset="0.6" />
<GradientStop Color="Red" Offset="0.8" />
<GradientStop Color="Transparent" Offset="0.8" />
<GradientStop Color="Transparent" Offset="0.9" />
<GradientStop Color="Red" Offset="0.9" />
<GradientStop Color="Red" Offset="1" />
</GradientStopCollection>
</LinearGradientBrush>
</Border.BorderBrush>
</Border>
但这仅适用于左/右或上/下