You will need Delphi XE and TMS Component
procedure TForm1.AdvOfficeMDITabSet1TabClose(Sender: TObject;
TabIndex: Integer; var Allow: Boolean);
var
form : TForm;
begin
form := AdvOfficeMDITabSet1.GetChildForm(AdvOfficeMDITabSet1.AdvOfficeTabs[TabIndex]);
form.Close;
Allow := False;
end;
procedure TForm1.New1Click(Sender: TObject);
var
c : TForm;
begin
c := TForm2.Create(Self);
c.Parent := Panel2;
c.SetBounds(0, 0, Panel2.Width, Panel2.Height);
c.Caption := 'Yohan ' + IntToStr(Panel2.ControlCount);
(c as TForm2).EllipsLabel1.Caption := c.Caption;
c.Show;
//introducing the power of delphi RTTI!
if(c.ClassType = TForm2) then
AdvOfficeMDITabSet1.AddTab(c);
end;
Tidak ada komentar:
Posting Komentar