Windows Phone 7图像按钮
发布时间:2020-12-13 20:56:14 所属栏目:Windows 来源:网络整理
导读:我需要为我的应用程序创建一个图像按钮,如面向web的样式。 我有一个20×20像素的图像,并且想要具有与图像相同尺寸的图像按钮。 我试图将它设置在我的xaml内,但它不起作用: Button Grid.Row="0" Margin="0" Padding="0" Click="AddtoFavorite_Click" Widt
我需要为我的应用程序创建一个图像按钮,如面向web的样式。
我有一个20×20像素的图像,并且想要具有与图像相同尺寸的图像按钮。 我试图将它设置在我的xaml内,但它不起作用: <Button Grid.Row="0" Margin="0" Padding="0" Click="AddtoFavorite_Click" Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right"> <Button.Content> <Image Source="/MyNamespace;component/images/star_yellow.png" Margin="0" Width="20" Height="20" /> </Button.Content> </Button> 哪里不对? 解 我发现最好的解决办法是: <Image Source="/MyNamespace;component/images/star_yellow.png" ManipulationStarted="Image_ManipulationStarted" Width="20" Height="20"></Image> 谢谢大家!
我的代码中没有看到特定的错误,但是现在我没有工具来测试它,看看它为什么失败。
但是,您可以使用您的图像创建一个VisualBrush,并将其用作Button的背景: <Button> <Button.Background> <ImageBrush ImageSource="xyz.png"/> </Button.Background> </Button> 大多数背景是Brush类型,所以您可以使用SolidColorBrush,LinearGradientBrush,ImageBrush等。您不限于颜色。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- active-directory – 如何在ActiveDirectory中获取OU的“de
- windows 工具命令 cmd
- 任何人都有删除特定本地Windows配置文件的脚本?
- 从.NET DLL – app.config问题消耗webservice
- .net – 从TripleDES更改Microsoft配置文件加密方法
- active-directory – 从旧服务器上的目录中删除打印机
- windows-server-2008-r2 – 撤消R2上的替换任务管理器
- windows-phone-7 – 适用于Windows Phone 7的WatermarkedTe
- 如何从命令行启动emacsclient最大化
- windows – 连接到剪贴板?
推荐文章
站长推荐
- windows – 使用.bat文件配置WinRM,不带/是提示
- windows – 将exec’d批处理文件中的退出代码传播
- windows-server-2008 – 如果要备份HyperV主机,我
- Win32 Hooks DLL注入针对“任何CPU”构建的应用程
- Windows环境下使用pip install安装lxml库
- SBS-2008上的Powershell ActiveDirectory-Module
- windows – 通过F5从域控制器负载平衡LDAP
- Windows中的PHP CLI:处理Ctrl-C命令?
- 导出DLL C类,关于.def文件的问题
- win-universal-app – Windows 10 Universal app
热点阅读