As
Sergey Alexandrovich Kryukov said :
You can use the Control property
Focused like that :
foreach (Control item in this.Controls)
{
if (item.Focused&&item.GetType()==typeof(TextBox))
{
MessageBox.Show("I'm the textbox focused");
}
}
Or for more easy and direct approach with
ActiveControl :
if (ActiveControl.GetType() == typeof(TextBox))
{
MessageBox.Show(ActiveControl.ToString());
}
Sorry if you feel that is a repost.