for (int i = 0; i < counter; i++)
{
Label lb = new Label();
lb.Width = 50;
lb.Height = 35;
lb.FontFamily = new FontFamily("LiSu");
lb.HorizontalAlignment = HorizontalAlignment.Left;
lb.VerticalAlignment = VerticalAlignment.Bottom;
lb.FontWeight = FontWeights.Bold;
Canvas.SetTop(lb, i * (-2));
lb.Background = Brushes.Transparent;
lb.HorizontalContentAlignment = HorizontalAlignment.Center;
lb.VerticalContentAlignment = VerticalAlignment.Center;
canEAChip_Idle5.Children.Add(lb);
}
我用for循环动态添加Label,我要怎么获取每个Label的名称呢,我想给添加出来的Label加上背景。
至尊宝的传说