【发布时间】:2011-06-23 09:19:15
【问题描述】:
我正在开发一个 windows phone 7 应用程序。我是 Windows Phone 7 应用程序的新手。在我的应用程序中,我动态创建了一个按钮控件,并将背景图像添加到按钮控件中,如下所示。
Button AlphabetButton = new Button();
AlphabetButton.Content = vAlphabet;
ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri("button_off.png", UriKind.Relative));
//brush.Stretch = Stretch.None;
AlphabetButton.Background = brush;
AlphabetButton.BorderBrush = new SolidColorBrush(Colors.Gray);
AlphabetButton.Margin = new Thickness(-12, -27, 0, 0);
AlphabetButton.Width = 80;
AlphabetButton.Height = 80;
我想删除按钮控件的边框,因为使用该边框时,图像不会按要求显示。这个怎么做?我们可以使用按钮控件的BorderThickness 属性来做到这一点,还是有其他方法?您能否提供我可以解决上述问题的任何代码或链接?如果我做错了什么,请指导我。
【问题讨论】:
标签: silverlight button windows-phone-7 background-image borderless