这个函数 procedure TWinControl.SetFocus; var Parent: TCustomForm; begin Parent := GetParentForm(Self); if Parent <> nil then Parent.FocusControl(Self) else if ParentWindow <> 0 then Windows.SetFocus(Handle) else ValidParentForm(Self); end;按住ctrl+点鼠标点击 setfocus 就看到了
procedure TWinControl.SetFocus;
var
Parent: TCustomForm;
begin
Parent := GetParentForm(Self);
if Parent <> nil then
Parent.FocusControl(Self)
else if ParentWindow <> 0 then
Windows.SetFocus(Handle)
else
ValidParentForm(Self);
end;按住ctrl+点鼠标点击 setfocus 就看到了