1.我们在开发程序时有时想知道当前界面光标聚焦在哪个控件,通过循环当前界面控件判断
foreach (Control c in this.Controls)
{
if(c.Focused)
{
MessageBox.Show(c.Name);
}
}
1.我们在开发程序时有时想知道当前界面光标聚焦在哪个控件,通过循环当前界面控件判断
foreach (Control c in this.Controls)
{
if(c.Focused)
{
MessageBox.Show(c.Name);
}
}