2009-12-15 41 views

回答

8

使用的圖像刷了Window.Background屬性:

<Window> 
    <Window.Background> 
    <ImageBrush ImageSource="..." /> 
    </Window.Background> 
</Window> 

一般來說,想着「我怎麼填一個元素的元素或部分」時(無論是窗口背景,文字塊前景或其他)答案將是一個畫筆,WPF允許你交替使用一個純色畫筆,漸變畫筆,圖像畫筆,視頻畫筆等等。所以你會尋找統一的背景和前景屬性,而不是像在WinForms中那樣分離BackgroundColor,BackgroundGradient,BackgroundImage,BackgroundVideo等屬性。

相關問題