G
gulan
Unregistered / Unconfirmed
GUEST, unregistred user!
我创建了一个子窗体,但运行后,子窗体为什么不能被激活!主窗体也不能被激活
代码如下
其中intForm为integer的公用函数.
procedure TForm1.Button1Click(Sender: TObject);
var
frmTemp: TForm;
TreeViewTemp: TTreeView;
begin
frmTemp:=TForm.Create(self);
Form1.InsertControl(frmTemp);
with frmTemp do
begin
Name:='Form'+inttostr(intForm+10);
Top:=60*intForm;
Width:=120;
Height:=60;
TreeViewTemp:=TTreeView.Create(self);
InsertControl(TreeViewTemp);
TreeViewTemp.OnMouseDown:=MouseDown;
TreeViewTemp.OnMouseUp:=MouseUp;
with TreeViewTemp do
begin
Name:='TreeView'+inttostr(intForm+10);
Align:=alClient;
end;
showmodal;
end;
inc(intForm);
end;
代码如下
其中intForm为integer的公用函数.
procedure TForm1.Button1Click(Sender: TObject);
var
frmTemp: TForm;
TreeViewTemp: TTreeView;
begin
frmTemp:=TForm.Create(self);
Form1.InsertControl(frmTemp);
with frmTemp do
begin
Name:='Form'+inttostr(intForm+10);
Top:=60*intForm;
Width:=120;
Height:=60;
TreeViewTemp:=TTreeView.Create(self);
InsertControl(TreeViewTemp);
TreeViewTemp.OnMouseDown:=MouseDown;
TreeViewTemp.OnMouseUp:=MouseUp;
with TreeViewTemp do
begin
Name:='TreeView'+inttostr(intForm+10);
Align:=alClient;
end;
showmodal;
end;
inc(intForm);
end;