1.Image控件的Source属性不知道后台怎么赋值
解决:
WPF中更改Image控件的source(使用相对路径)
博客地址:http://blog.csdn.net/cdjcong/article/details/8491292
绝对路径:
BitmapImageimagetemp = new BitmapImage(new Uri("E:\\Work\\Demo2.bmp",UriKind.Absolute));
image1.Source= imagetemp;
相对路径:
BitmapImageimagetemp = new BitmapImage(newUri("\\bin\\Debug\\Sources\\ON_btn_AutoDetect.bmp",UriKind.Relative));
image1.Source= imagetemp;
2.WPF去掉窗体边框
解决:
WPF 去掉窗体边框
链接地址:http://blog.sina.com.cn/s/blog_8600e72b0101exxn.html
设置 WindowStyle="None"、 AllowsTransparency="True" 即可。如下:
Window x:Class="WpfApplication1.MainWindow"
· xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
· xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
· Title="MainWindow" Height="350" Width="525"
· WindowStyle="None"
· AllowsTransparency="True">
· <Grid>
· </Grid>
· </Window>