How to prevent clicks on menus and toolbars to steal focus from a floating form?

I want to achieve the same effect as in Visual Studio 2010+, where if you are floating above the editor on top of the main form, clicking on the main menu of the form or on the toolbar does not cause the main form to steal focus; instead, a floating window maintains focus.

Without this, it becomes impossible to call any command of the main menu that works on the focused control when the focused control is in a floating window - because the control that you want to use loses focus in the same way as the command is called.

Illustration of menu not stealing focus from floating window

( , , , , , . Visual Studio, , - .)

+4
1

, TActionMainMenuBar TActionToolBar.

: TActionMainMenuBar AutoFocus, True. False, , . , , .

: TActionToolBar AutoFocus. OnMouseActivate maNoActivate.

, maNoActivate OnMouseActivate . , TButton, , OnMouseActivate. TActionToolBar , .

, , Google , "AutoFocus", "OnMouseActivate", (, , ). , - .

+5

Source: https://habr.com/ru/post/1532820/


All Articles