gpt4 book ai didi

c# - 使用 C# 在 WPF 中的网格上设置背景图像

转载 作者:IT王子 更新时间:2023-10-29 03:56:39 24 4
gpt4 key购买 nike

我有一个问题:我想通过隐藏代码设置我的网格图像。

有人能告诉我怎么做吗?

最佳答案

所有这些都可以通过在网格中添加以下代码在 xaml 中轻松实现

<Grid>
<Grid.Background>
<ImageBrush ImageSource="/MyProject;component/Images/bg.png"/>
</Grid.Background>
</Grid>

留给您做的是,向名为“Images”的解决方案添加一个文件夹,并将现有文件添加到新的“Images”文件夹,在本例中称为“bg.png”

关于c# - 使用 C# 在 WPF 中的网格上设置背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3100837/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com