MDI 폼을 부르는 함수를 만들고 싶습니다..
for i := MDIChildCount - 1 downto 0 do
begin
if MDIChildren[i].Name = formname then
begin
MDIChildren[i].Show;
MDIChildren[i].WindowState := wsNormal;
SysUtils.Abort;
end;
end;
formname := Tformname.Create(Application);
이렇게 만들구 싶은데..저기 formname := Tformname.Create(Application); 가 문제입니다.
아시는분 답변좀 부탁드립니다..
function CredateWindow(var F: TForm; TF: TFormClass ; Find_ClassName : String) : Boolean;
var i : Integer;
MainForm: TForm;
begin
result := True;
Screen.Cursor := crHourGlass;
MainForm := Application.MainForm;
with MainForm do
begin
if MDIChildCount > 0 then
begin
for i := 0 to MDIChildCount - 1 do
if UpperCase(MDIChildren[i].ClassName) = UpperCase(Find_ClassName) then
begin
MDIChildren[i].BringToFront;
MDIChildren[i].WindowState := wsNormal;
Screen.Cursor := crDefault;
Exit;
end;
end;
end;
//생성되지 않았거나 Mdi_Child Form이 아니라면 Form을 Create한다.
if(IsExist_Form(Find_ClassName)) = False then
Application.CreateForm(TF, F);
Screen.Cursor := crDefault;
end;