如图,我想获取当前窗体的所有Label,用如下代码获取,我用MessageBox测试,就是进不去执行MessageBox,为什么就是获取不了窗体的Label呢???第一次使用
请指教,谢谢啊啊啊啊!!!!!
foreach (System.Windows.Forms.Control item in this.Controls)
{
if (item is System.Windows.Forms.Label)
{
MessageBox.Show("1111111111111111111111111111111111");
control = item as System.Windows.Forms.Label;
if (control == null)
{
return;
}
if (this.userName[inlneUser] == control.Text)
{
UpLine(inlneUser);
}
}
}