il frametabellaII è:
type
TFrameTabellaII = class(TMyCustomPageFrame)
il TMyCustomPageFrame è il frame che tu mi suggeristi di utilizzare...
un frame Vuoto con dentro 3 eventi...:
public
{ Public declarations }
procedure InitializePage; virtual;
procedure ClosePage; virtual;
procedure RefreshStyle; virtual;
end;
non so se ricordi....
per passare un parametro che nel mio caso è il nome della tabella (da anni fa - quando avevo ancora meno conoscenza di oggi-) utilizzavo sempre la proprieta hint del frame che creavo.
adesso, in più, sul frame ho messo un tbutton con il quale visualizzo una finestra MODALE nella quale gestire la tabella 'COMUNI' (non è importante se minuscolo o MAIUSCOLO)codice:procedure TFrmMain.ShowPage(PageClass: TMyPageFrameClass; Pulsante:String); begin if PageClass = nil then Exit; if (FCurrentPage <> nil) and (FCurrentPage.Hint = Pulsante) then Exit; if FCurrentPage <> nil then begin // FrmMain.Caption:=NomeProgramma+' - '+NomeOperatore ; screen.Cursor := crHourGlass; FCurrentPage.ClosePage; FCurrentPage.Free; FCurrentPage := nil; screen.Cursor := crDefault; end; FCurrentPage := PageClass.Create(Self); FCurrentPage.Hint := Pulsante; try if FCurrentPage <> nil then begin screen.Cursor := crHourGlass; FCurrentPage.Parent := FrmMain ; FCurrentPage.InitializePage; screen.Cursor := crDefault; end; except screen.Cursor := crHourGlass; FCurrentPage.ClosePage; FrmMain.Caption:=NomeProgramma+' - '+NomeOperatore ; FCurrentPage.Free; FCurrentPage := nil; try ShowPage(TFrameMenuPulsanti,MenuHome.Name); except end; screen.Cursor := crDefault; end; end;
il findcomponent lo utilizzo per assegnare al nuovo form e al nuovo frame un nome univoco ma certamente da come mi fai intendere è inutile! nell'esempio HO SBAGLIATO per la fretta scusa. ....
MioFrame.Name :='MioFrametttttt'+IntToStr(i);

Rispondi quotando
