Как в C++ Builder (или Delphi) узнать на каком компоненте находится в данный момент фокус?
Здравствуйте, AlexFed, Вы писали:
AF>Как в C++ Builder (или Delphi) узнать на каком компоненте находится в данный момент фокус?
TScreen::ActiveControl
Description
Read ActiveControl to learn which windowed control object in the active form currently receives the input from the keyboard.
ActiveControl is a read-only property. To change the ActiveControl, use the SetFocusedControl method of the form that contains the control that should receive focus.
After focus shifts from one control to another, the screen receives an OnActiveControlChange event.
Также имеется TCustomForm::ActiveControl (позволяет устанавливать фокус).
Ну и наконец WINAPI: HWND GetFocus (VOID);