我有WPF應用程序,在我的一個WPF窗體中有TextBlock。我將TextBlock放置在ScrollViewer中以提供滾動功能。我想TextBlock邊框,所以,我已經寫在XAML
以下代碼。當TextBlock放置在ScrollViewer裏時在TextBlock上顯示邊框
<ScrollViewer Margin="230,32,12,147">
<Border BorderThickness="1" BorderBrush="Black">
<TextBlock Name="textBlock1"></TextBlock>
</Border>
</ScrollViewer>
使用scrollBar GUI顯示如下。上滾動
下邊框顯示器下來到TextBlock。用戶體驗不適合這種設計。所以,我試着用下面的代碼,但邊框不顯示。
<Border BorderThickness="1" BorderBrush="Black">
<ScrollViewer Margin="230,32,12,147">
<TextBlock Name="textBlock1"></TextBlock>
</ScrollViewer>
</Border>
當TextBlock放置在ScrollViewer中時,如何顯示邊框?
我解決了<邊框BorderBrush = 「黑」 了borderThickness = 「1」 保證金= 「230,32,12,147」> <的ScrollViewer> 的ScrollViewer > –