공부방/Delphi
[델파이] 클래스명으로 폼 찾기(체크)
래채
2019. 6. 10. 15:05
-- 찾기
function FindForm(const FormName: string) : TForm;
var
i : Integer;
begin
Result:= nil;
for i := 0 to Screen.FormCount - 1 do
begin
if 0 <> CompareText(Screen.Forms[i].ClassName, FormName) then Continue;
Result := Screen.Forms[i];
Break;
end;
end;
-- 체크
function CheckForm(const FormName: string) : boolean;
var
i : Integer;
begin
Result := False;
for i := 0 to Screen.FormCount - 1 do
begin
Result := CompareText(Screen.Forms[i].ClassName, FormName) = 0;
if Result then
Break;
end;
end;