[Lazarus] How to create a non focusable form?

Gabor Boros gaborboros at yahoo.com
Wed Oct 28 11:43:57 CET 2015


2015.10.28. 10:59 keltezéssel, Zeljko írta:
>
> Please test with attached patch and give feedback. Note that this patch
> is tested under Qt X11 only.
>
> zeljko

With the original example works but...

Modified the example...

procedure TForm1.Button1Click(Sender: TObject);
var
   MyForm:TMyForm;

begin
   MyForm:=TMyForm.CreateNew(Nil);
   with TButton.Create(MyForm) do Parent:=MyForm;
   MyForm.Show;
end;

The button appear on the form only if modify ControlStyle in the example 
from

ControlStyle:=ControlStyle+[csNoFocus,csNoStdEvents]-[csCaptureMouse,csClickEvents];

  to

ControlStyle:=ControlStyle+[csNoFocus]-[csCaptureMouse,csClickEvents];

(csNoStdEvents removed) but after form grab focus if click on it or 
click on the button.

Gabor




More information about the Lazarus mailing list