使用 Blend3 创建的按钮上的背景图像

发布于 2024-10-01 18:08:30 字数 242 浏览 0 评论 0原文

我想问如何更改使用 Expression Blend 3 创建的按钮上的背景图像,我知道 VS 中的普通按钮有一个 BackgroundImage 属性,但我似乎在这个项目中找不到它,想法是更改背景单击按钮时的图像,但我似乎找不到如何操作。

唯一可以帮助我的属性是“背景”属性,但它没有说明有关图像本身或类似内容的任何内容,甚至没有更改颜色的内容。

感谢您抽出时间。

问候

PS:这个项目是用 C# 完成的

I wanted to ask how to change a background image on a button created with Expression Blend 3, I know normal buttons in VS have a BackgroundImage property, but I can't seem to find it on this project, the idea is to change the background image when the button is clicked but I can't seem to find how to do it.

The only property that could help me is the Background property but it doesn't state anything about an image itself or anything like that, not even something to change the color.

Thanks for your time.

Regards

PS: This project is done in C#

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身仙ぐ女味 2024-10-08 18:08:30

好吧,我找到了答案,所以我将其发布在这里,以防有人有同样的问题:

ImageBrush brush = new ImageBrush(new BitmapImage(new Uri("pack://siteoforigin:,,,/images/yourimage.gif")));
brush.Stretch = Stretch.Uniform;
btn.Background = brush;

我在这里找到了答案:链接文本

Well I found the answer so I'll post it here in case someone ever has the same question:

ImageBrush brush = new ImageBrush(new BitmapImage(new Uri("pack://siteoforigin:,,,/images/yourimage.gif")));
brush.Stretch = Stretch.Uniform;
btn.Background = brush;

I found the answer here: link text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文