Hallo Neuni, es geht - und zwar so:
Delphi-Quellcode:
function TabSheetByCaption(pc: TPageControl; s: string): TTabSheet;
var
i: integer;
begin
Result := nil;
for i := 0 to Pred(pc.PageCount) do
if AnsiCompareText(pc.Pages[i].caption, s) = 0 then
begin
Result := pc.Pages[i];
Exit;
end;
end;
function FirstControl(wc: TWinControl; cn: String): TControl;
var
i: integer;
begin
for i := 0 to Pred(wc.ControlCount) do
begin
Result := wc.Controls[i];
if CompareText(Result.ClassName, cn) = 0 then
Exit;
end;
Result := nil;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
ts: TTabSheet;
re: TRichEdit;
begin
ts := TabSheetByCaption(PageControl, 'TabSheet1');
if Assigned(ts)
then re := FirstControl(ts, 'TRichEdit') as TRichEdit
else re := nil;
end;
Grüße vom marabu