📄 findglob.pas
字号:
unit FindGlob;
interface
uses
Classes, DsgnIntf, Forms, SysUtils;
function FindGlobalComp (const Name: string;
List: TComponentList): Boolean;
implementation
function FindGlobalComp (const Name: string;
List: TComponentList): Boolean;
var
I, J, InitCount: Integer;
Form, Comp: TComponent;
begin
InitCount := List.Count;
for I := 0 to Screen.FormCount - 1 do
begin
Form := Screen.Forms[I];
if CompareText(Name, Form.Name) = 0 then
List.Add (Form);
for J := 0 to Form.ComponentCount - 1 do
begin
Comp := Form.Components [J];
if CompareText(Name, Comp.Name) = 0 then
List.Add (Comp);
end;
end;
for I := 0 to Screen.DataModuleCount - 1 do
begin
Form := Screen.DataModules[I];
if CompareText(Name, Form.Name) = 0 then
List.Add (Form);
for J := 0 to Form.ComponentCount - 1 do
begin
Comp := Form.Components [J];
if CompareText(Name, Comp.Name) = 0 then
List.Add (Comp);
end;
end;
// true if found
Result := (List.Count - InitCount) > 0;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -