就是 目录树的点击事件上 难道不行?
procedure TShowForm.TreeView1Click(Sender: TObject);
var
EditForm: XYDAGL_FUNC.TMAINFORM;
begin
if TreeView1.Selected.SelectedIndex = 31 then
begin
if not Assigned(EditForm) then
begin
ShowTab;
EditForm := XYDAGL_FUNC.TMAINFORM.Create(Self.Context);
try
EditForm.Show;
EditForm.Parent := TabSheet;
finally
if EditForm.CloseSign = 1 then
begin
EditForm.Free;
EditForm := nil;
end;
end;
end;
end;
end;