I found some nice code by both Marco Cantu and Zarko that puts a form inside a TPagecontrol like this:
procedure Tfrm_FrontMain.tsStatistikShow(Sender: TObject);
if FrmStatistik=Nil then begin
if (Sender is TTabSheet)=False then raise Exception.Create('Should be tabsheet');
Sheet:=Sender as TTabsheet;
with FrmStatistik do begin
I have done one change, I dont create a new PageSheet - i use an existing and that creates a problem. Im using the "OnShow" event of the Tabsheet to create the form (tsStatistikShow) . The form does get created, but remains invisible until i change the active page and then clicks back to the tab that holds the form.
How can I get the form to be painted when its is created?