我希望把對鉻按鈕,我發現這個解決方案Solution.WPF背景renderin錯誤
但它渲染backgrond爲黑色。我沒有在任何地方設置黑色,它是怎樣的黑色?
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="0.5,28,0,0.5" NonClientFrameEdges="Right"/>
</WindowChrome.WindowChrome>
<Window.Template>
<ControlTemplate>
<ContentPresenter Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Window}, Path=Content}"/>
</ControlTemplate>
</Window.Template>
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right">
<Button Content="Help" WindowChrome.IsHitTestVisibleInChrome="True" Height="28" Margin="0,0,120,0"/>
</StackPanel>
您的窗口是否有內容? – dotNET
已編輯的問題 – murmansk
嘗試兩個快速的事情。首先將你的StackPanel的路線設置爲'Stretch'。其次,使用'GlassFrameThickness'來玩看看是否有任何效果。 – dotNET