5,379
社区成员
发帖
与我相关
我的任务
分享
Form := FormClass.Create(TabCtrl);
LockWindowUpdate(TabCtrl.PageControl.Handle);
with Form do
try
ManualDock(TabCtrl);
ShowCaption(TabCtrl, Caption);
Show;
Form.WindowState := wsMaximized;
Form.Align := alClient;
TabCtrl.Data := Form; // 这里保存了当前出创建的窗体的引用
except
Free;
end;
finally
procedure TForm1.Button1Click(Sender: TObject);
var
f2: TForm2;
begin
RzPageControl1.ActivePageIndex := 0;
f2 := TForm2(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data);
f2.Edit1.Text := '测试';
end;
procedure TForm1.Button2Click(Sender: TObject);
var
f3: TForm3;
begin
RzPageControl1.ActivePageIndex := 1;
f3 := TForm3(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data);
if
f3.openpicturedialog1.execute then
begin
RzPageControl1.ActivePageIndex := 0;
f3.Image1.Picture.loadfromfile(f3.openpicturedialog1.filename);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
RzPageControl1.ActivePageIndex := 0;
TForm2(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data).Edit1.Text
:= '测试';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RzPageControl1.ActivePageIndex := 1;
if
TForm3(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data).openpicturedialog1.execute then
begin
RzPageControl1.ActivePageIndex := 0;
TForm3(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data).Image1.Picture.loadfromfile(
TForm3(RzPageControl1.Pages[RzPageControl1.ActivePageIndex].Data).openpicturedialog1.filename);
end;
end;