public Button FindButtonBackgroundWithoutPicture()
{
Button btn = null;
///遍历控件 chilren ,var
foreach (var item in this.ContentPanel.Children)
{
if (item.GetType() == typeof(Button))
{
btn = item as Button;
if (GetBackgroundIndex(btn) == 1)
{
return btn;
}
}
}
return null;
}
ContentPanel是Grid控件的名称 |
|