동적으로 새 페이지를 만든다는 말은
tabsheet를 한개 만든다는 말로 들리는 군요..
아래와 같이 해 보세요 그러면 될 것입니다.
with PageControl1 do
with TTabSheet.Create(Self) do
begin
PageControl := PageControl1;
Caption := '새 페이지';
end;
참고가 되었으면 합니다.
그리고 델파이 도움말에 있는 예제를 참고로
추가하면
This example creates ten Tab Sheets and sets the captions to display
PageIndex and TabIndex for each tab. Odd numbered tabs have their
TabVisible property set off to demonstrate the effect on PageIndex
vs TabIndex. On the series of visible tabs, PageIndex will read
0, 2, 4, 6, 8, and TabIndex will read 0, 1, 2, 3, 4. PageIndex
counts only visible tabs.
Note: Pages[i] is of type TTabSheet.
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
with PageControl1 do
for i := 0 to 9 do
with TTabSheet.Create(Self) do
begin
PageControl := PageControl1;
Caption := 'PageIndex: ' +
IntToStr(Pages[i].PageIndex) + ' TabIndex: ' +
IntToStr(Pages[i].TabIndex);
Pages[i].TabVisible := (i mod 2 = 0);
end;
end;
그리고 원하시는 페이지캡션을 넣었을 때 추가하고
싶으면 그쪽이벤트에 제가 적어드린 소스를 넣고
단지 caption:edit1.caption 이렇게 바꾸기만 하면 될 것입니다.
왠지 두서없이 똑같은 말만 되풀이 한 것 같네요.. ^.^
- 델파이왕 -
p.s. 왜 연락이 없어요.. ^.^
연락 좀 주세요..
|