How to identify active control on a form [modified]
-
Hello, The users require a shortcut key to allow them to navigate from one groupbox to the next. I am catching the key press event in the forms base class. The group boxes that will be available for navigation are in an arraylist that is available to the base class. How can I determine which groupbox is currently active? I tried the Focused property, but it always returns false. I have looped through each groupbox's Controls collection, and tested the Focused property of each control, but they all return false as well. Is there any method or property that I can use to determine the active control? Or will I need to do this manually? -- modified at 13:01 Monday 7th August, 2006 I am using C#, VS 2003.
-
Hello, The users require a shortcut key to allow them to navigate from one groupbox to the next. I am catching the key press event in the forms base class. The group boxes that will be available for navigation are in an arraylist that is available to the base class. How can I determine which groupbox is currently active? I tried the Focused property, but it always returns false. I have looped through each groupbox's Controls collection, and tested the Focused property of each control, but they all return false as well. Is there any method or property that I can use to determine the active control? Or will I need to do this manually? -- modified at 13:01 Monday 7th August, 2006 I am using C#, VS 2003.
I believe that the static
Form.ActiveControl
property is what you need.:josh: My WPF Blog[^]
-
I believe that the static
Form.ActiveControl
property is what you need.:josh: My WPF Blog[^]
-
Thank you, that gets the job done. BTW it is an instance, not static, property.
No eternal reward will forgive us now for wasting the dawn. - Jim Morrison
dennisd45 wrote:
BTW it is an instance, not static, property.
Doh! Of course, it doesn't make sense for it to be static. Sorry about that. :doh:
:josh: My WPF Blog[^]