窗口图标与背景

2017-12-31  本文已影响0人  Lulus
1

图标Icon

Icon="Images/icon.jpg"

背景图Background

<Window.Background>
    <ImageBrush ImageSource="Images/background.jpg"></ImageBrush>
</Window.Background>

完整代码:

<Window x:Class="WpfDemo.WindowIconAndBackground.WindowIconAndBackgroundDemo"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfDemo.WindowIconAndBackground"
        mc:Ignorable="d" Icon="Images/icon.jpg"
        Title="WindowIconAndBackgroundDemo" Height="350" Width="600">
    <Window.Background>
        <ImageBrush ImageSource="Images/background.jpg"></ImageBrush>
    </Window.Background>
    <Grid>
        
    </Grid>
</Window>

示例代码

https://github.com/zLulus/NotePractice/tree/dev3/WPF/WpfDemo/WindowIconAndBackground

上一篇下一篇

猜你喜欢

热点阅读