Delphi - setting the form so as not to focus on any component when it shows

Is there a way in Delphi to prevent a form from focusing on any of its components, but not to disable these components? I tried Self.SetFocus in the FormActivate event of the form, but the program says that it cannot focus on the disabled component.

+6
delphi
source share
1 answer

Use the following OnActivate event handler:

procedure TForm1.FormActivate(Sender: TObject); begin ActiveControl:= nil; end; 
+12
source share

All Articles