void LoadPage() { int count=5; //Image[] im=new Image[count]; int cc=0; for(int i=1;i<=count;i++) { Rectangle r=new Rectangle(); r.Name="r"+i.ToString(); // im[i].Source=new BitmapImage(new Uri("img/sha.jpg", UriKind.Relative)); //r1.Fill=(new BitmapImage(new Uri("img/sha.jpg"))); r.Fill = new ImageBrush() { ImageSource = new BitmapImage(new Uri("img/sha.jpg", UriKind.Relative))}; r.Width=96; r.Height=134; r.Margin=new Thickness(cc,0,0,0); LayoutRoot.Children.Add(r); cc+=100; } r2.Fill=new ImageBrush() { ImageSource = new BitmapImage(new Uri("img/shan.jpg", UriKind.Relative))}; } 这样定义好了r2,请问r2如何访问的到呢?