We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

which control had focus before toolbar button pressed

Thread ID:

Created:

Updated:

Platform:

Replies:

32378 Jul 28,2005 11:05 AM Jul 29,2005 10:43 AM General Discussion 2
loading
Tags: General Discussion
Ross Prestmo
Asked On July 28, 2005 11:05 AM

Hi. I was wondering what the best way would be to determine which grid (or any control type) on a windows form had the focus just prior to the user pressing a toolbar button. I''m trying to put a generic "Query Data" button on a toolbar, which will refresh the data of any data-bound control that has focus when the button was pressed. Thanks for your help. Ross.

Sean Greer
Replied On July 28, 2005 07:48 PM

Perhaps Form.ActiveControl is what you''re looking for? >Hi. > >I was wondering what the best way would be to determine which grid (or any control type) on a windows form had the focus just prior to the user pressing a toolbar button. > >I''m trying to put a generic "Query Data" button on a toolbar, which will refresh the data of any data-bound control that has focus when the button was pressed. > >Thanks for your help. > >Ross.

Ross Prestmo
Replied On July 29, 2005 10:43 AM

Thanks. Yeah that will do it. I thought that the toolbar button would get returned as the ActiveControl as soon as I pressed it, like a normal button control does. Lots to learn ... :)

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;