1
我有一个图像控件。在运行时单击图像时,它应该作为孩子添加到网格中。我已经实现了这一点。点击图像时围绕图像
我现在的要求是当图像(现在在一个网格内)被挖掘时我需要一个图像边框。我怎样才能做到这一点?
我加入里面挖掘图像下面的代码,但不能看到边框
Border b = new Border();
b.BorderThickness = new Thickness(4);
img1 = new Image();
img1.MaxHeight = 300;
img1.MaxWidth = 500;
b.Child = img1;
img1.Source = new BitmapImage((new Uri(imgPath, UriKind.RelativeOrAbsolute)));
grid1.Children.Add(b);
与大家分享您的烃源代码给你一个活生生的例子 – 2012-05-03 03:40:55
我认为使用[螺纹](http://msdn.microsoft.com/ en-us/library/windows/apps/windows.ui.xaml.uielement.tapped.aspx)事件,而不是MouseEnter和MouseLeave,将与OP所要求的更紧密地匹配。 –
@JaimeOlivares请找到上面的代码。 – spiharsh