开发者

Delphi - Set form to not focus on any component when it shows

开发者 https://www.devze.com 2023-01-08 17:39 出处:网络
Is there a way in Delphi to disallow the form to focus o开发者_JS百科n any of its components but not disabling those components? I tried Self.SetFocus on FormActivate event of the form but the program

Is there a way in Delphi to disallow the form to focus o开发者_JS百科n any of its components but not disabling those components? I tried Self.SetFocus on FormActivate event of the form but the program says that it cannot focus on a disabled component.


Use the following OnActivate event handler:

procedure TForm1.FormActivate(Sender: TObject);
begin
  ActiveControl:= nil;
end;
0

精彩评论

暂无评论...
验证码 换一张
取 消