我正在开发window 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;
我可以看到按钮控件的背景图像,但它不适合按钮控件占用的空间。我可以看到按钮控件右侧和底部边框上的空白区域。这是因为图像不适合按钮控件占用的空间。我应该如何在背景中添加图像,使其适合按钮控件占用的空间。您能否提供我可以解决上述问题的任何代码或链接?