![](/img/trans.png)
[英]HorizontalAlignment="Stretch" not working in TreeViewItem
[英]wpf horizontalalignment left and stretch?
我想將邊框大小更改為父級的大小,但只能增長到最大大小。
如果高度和寬度小於 50,則水平和垂直將被拉伸。 但是當它達到50后,它變為居中,高度和寬度大小為50固定
例如,如果它達到 50,它看起來像這樣
| □ |
但我想要的是這個
|ㅁ |
我的 xaml 代碼在這里
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MaxHeight="50" MaxWidth="50">
謝謝,Shubham Sahu 的回答幫助了我
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" MaxWidth="10"/>
<ColumnDefinition Width="4*" MaxWidth="60"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
將 MaxWidth 設置為 Column 定義解決了這個問題!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.