silverlight 程序中为什么button控件中的image控件不能显示图片 silverlight 程序中为什么button控件中的image控件不能显示图片 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是可以的,<Button Height="100" HorizontalAlignment="Left" Margin="223,112,0,0" Name="button1" VerticalAlignment="Top" Width="323"> <Button.Content> <Image Height="130" HorizontalAlignment="Left" Margin="28,12,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="268" Source="/SilverlightApplication1;component/Images/2010517142755.jpg" /> </Button.Content></Button>确保你的image路径正确,首先能在Image控件里面正常显示。你可以编辑image的Souce,在编辑器里面添加。 <Button Height="107" HorizontalAlignment="Left" Margin="10,10,0,0" Name="button1" VerticalAlignment="Top" Width="170" > <Button.Content > <Image Height="84" HorizontalAlignment="Left" Margin="42,141,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="105" Source="/SbSCh2_2;component/20081421114378_2.jpg" /> </Button.Content> </Button>仍然不行在帮俺看看呗 本帖最后由 net_lover 于 2011-11-01 11:35:29 编辑 我找到原因了,原因在于image的属性Margin的值,应将其全部设置成0,将image的位置指定在了原点位置,就可以看到了! 为什么ASP.NET的源码项目要用这么多的存储过程 大家帮忙侃侃:手动绑定GRIDVIEW来显示数据 请教,vs2005和vs2008可否同时存在? 页面传值问题 为什么执行到这里,没有弹出操作窗口? 输出excel的乱码问题 100分求freetextbox控件——web开发用的 asp.net插入视屏只有声音没显示图像 为什么IIS设了默认站点后 访问其他的虚拟目录都访问了默认站点的webconfig文件 顶:[我与CSDN]一个非常重要的说明,请大家周知 用iframe点击保存多张图片遇到的问题 asp.net问卷设计取值的问题
<Button.Content>
<Image Height="130" HorizontalAlignment="Left" Margin="28,12,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="268" Source="/SilverlightApplication1;component/Images/2010517142755.jpg" />
</Button.Content>
</Button>确保你的image路径正确,首先能在Image控件里面正常显示。你可以编辑image的Souce,在编辑器里面添加。
<Button.Content > <Image Height="84" HorizontalAlignment="Left" Margin="42,141,0,0"
Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="105"
Source="/SbSCh2_2;component/20081421114378_2.jpg" /> </Button.Content>
</Button>
仍然不行
在帮俺看看呗