I have 2 components: a TreeView and a ListBox in a form.
How can I detect (using VB .NET code)which component is the one I'm currently working on?
Please guide. Thank you.
Printable View
I have 2 components: a TreeView and a ListBox in a form.
How can I detect (using VB .NET code)which component is the one I'm currently working on?
Please guide. Thank you.
The code is in C#, so if you need help converting it, let me know:
Code:private void button1_Click(object sender, System.EventArgs e) {
foreach (Control c in this.Controls) {
if (c.Focused) {
MessageBox.Show("Name: " + c.Name + " Has Focus.");
return;
}
}
}