Delphi 主表單動態呼叫DLL的一個子表單。 怎么判斷DLL子表單是否已存在(在主表單中已打開),
如果打開則只需要置前
動態呼叫代碼如下:
// DllFormName 為 DLL中的一個子表單
// ParentForm 為 主表單
Application := App;
TheClass := GetClass(DllFormName);
if (TheClass = nil) then exit;
if TheClass.InheritsFrom(TForm) then
begin
try
begin
aForm := TForm(TheClass.Create).Create(ParentForm);
aForm.FormStyle := fsMDIChild;
aForm.Show;
aForm.BringToFront;
finally
FreeLibrary(ParentForm.Handle);
end;
end;
uj5u.com熱心網友回復:
你不是用aForm保存這個表單了嗎再判斷的話,繼續判斷aform就行了啊
uj5u.com熱心網友回復:
if not Assigned(MID_1_Frm) thenbegin
MID_1_Frm:=TMID_1_Frm.Create(Self);
MID_1_Frm.WindowState:=MID_WindowState;
end
else MID_1_Frm.BringToFront;
uj5u.com熱心網友回復:

做一個公共變數,存在的賦值,然后可以判斷出來了。。。。。。。。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/81169.html
標籤:VCL組件開發及應用
上一篇:有用Intraweb的哥們嗎??
