2009-04-30 38 views
0

有沒有辦法讓WPF中的控件/圖像/等「不在」Window/Chrome(即Aero的玻璃)?在WPF中控制「窗外/鍍鉻」

我的意思是WPF Yahoo Messenger的一個例子,它在一段時間後被釋放(然後停止)。 WindowStyle看起來像設置爲None,但AllowTransparencies/CanResize分別設置爲false/true,並且頭像略微「超出窗口/鑲邊」。

我知道我可能創建我自己的玻璃邊框,但這可能是一個相當努力,使其看起來一致。

回答

3

是的,我相信你將不得不用你自己的界面替換窗口。您可以從透明窗口開始,並在網格周圍留下一些邊距。然後將大拇指,標題欄等放在網格上以模擬窗口行爲。網格邊緣將允許您在「窗口」之外繪製控件。

<Window 
x:Class="TransparentFormDemo.Window2" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="Window2" Height="300" Width="300" 
AllowsTransparency="True" 
WindowStyle="None" Background="Transparent"> 
<Grid Margin="20" Background="AliceBlue"> 
    <Thumb Name="topThumb" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
      DragDelta="topThumb_DragDelta" Cursor="SizeNS"/> 
    <!--Thumbs continued--> 
    <Polygon Points="10,110 60,10 110,110" Fill="Blue" Margin="0,-30"/> 
</Grid> 
</Window> 
+0

堅果,我希望保留/尊重窗口鉻無論操作系統版本,但沒有辦法做到這一點使用該方法。 – 2009-05-01 10:29:17