[Lazarus] How to create a non focusable form?

Zeljko zeljko at holobit.net
Tue Oct 27 16:16:12 CET 2015



On 10/27/2015 04:04 PM, Gabor Boros wrote:
> Hi All,
>
> I want to create a borderless non modal form (native Windows and
> Linux-Qt) which not catch the focus on mouse click. Tried with modified
> ControlStyle and CanFocus override but without success. Any other idea?

csNoFocus does not work for Qt ? Can you provide example ?
For Qt: before example try to include qt4 and qtwidgets into your unit 
and then
in CreateWnd of your custom form (or after form handle is created)

TQtMainWindow(YourForm.Handle).SetFocusPolicy(QtNoFocus);
TQtMainWindow(YourForm.Handle).WindowArea.SetFocusPolicy(QtNoFocus);

zeljko






More information about the Lazarus mailing list