美文网首页
窗口图标与背景

窗口图标与背景

作者: Lulus | 来源:发表于2017-12-31 18:29 被阅读0次
    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

    相关文章

      网友评论

          本文标题:窗口图标与背景

          本文链接:https://www.haomeiwen.com/subject/zcyagxtx.html