代码片断:
参考网址:
http://bbs.csdn.net/topics/320181496
- Label tmpLabel;
- string testStr = string.Empty;
-
- for (int i = 0; i this.ParentGrid.Children.Count; i++)
- {
- if (this.ParentGrid.Children[i] is Label)
- {
- tmpLabel = this.ParentGrid.Children[i] as Label;
- if (tmpLabel.Tag != null && !string.IsNullOrWhiteSpace(tmpLabel.Tag.ToString()))
- {
- if (Convert.ToInt32(tmpLabel.Tag) == (int)dataconnect)
- tmpLabel.Content = newText;
- }
- }
- }
http://bbs.csdn.net/topics/320181496