Q
Problem solve Get help with specific problems with your technologies, process and projects.

How can I determine what text field is on my form has focus, so I know where to apply the selections

I have a menu option to display the FontDialog on my Visual Studio .NET Windows Form. How can I determine what text field is on my form has focus, so I know where to apply the selections made on the FontDialog screen? For example, I have several fields for remarks on my form and don't know which field the user was in when he selected the Format -> Font menu option. I want to apply the font selections to the field with current focus only.
As System.Windows.Forms.Form is derived from System.Windows.Forms.ContainerControl, you can use the ActiveControl property to get or set the active control on the form.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close