Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Output page in other Form/Unit
Tue, Oct 2 2012 12:26 PMPermanent Link

Sergei Safar

Hi All,

is it possible to set the FormOutputPage property of a Panel to point to a Page that is in other Form then the current one?

Regards,

Sergei Safar
Wed, Oct 3 2012 1:57 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Sergei,

Yes, but as controls in other forms are by default declared as private, you will have to expose it first:
Lets say your Page is declared in Form2 and is called Page2; you would have to declare it as:

unit Unit2;
type
   TForm2 = class(TForm)
      Page2: TPage;
   public
      property ResultsPage: TPage read Page2;
   end;

And then add "Uses Unit2;" to the unit where the submitted form is and set FormOutputPage at runtime:

  FormPanel.FormOutputPage := Form2.ResultsPage;


--
Fernando Dias
[Team Elevate]
Wed, Oct 3 2012 5:11 PMPermanent Link

Sergei Safar

Hi Fernando,

it worked fine. One important thing based on your example: The name Page2 should not exist in other forms/units, otherwise the result will be blank

Thank you.

Regards,
Sergei Safar


Fernando Dias wrote:

Sergei,

Yes, but as controls in other forms are by default declared as private, you will have to expose it first:
Lets say your Page is declared in Form2 and is called Page2; you would have to declare it as:

unit Unit2;
type
   TForm2 = class(TForm)
      Page2: TPage;
   public
      property ResultsPage: TPage read Page2;
   end;

And then add "Uses Unit2;" to the unit where the submitted form is and set FormOutputPage at runtime:

  FormPanel.FormOutputPage := Form2.ResultsPage;


--
Fernando Dias
[Team Elevate]
Thu, Oct 4 2012 7:32 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Sergei,

<< One important thing based on your example: The name Page2 should not
exist in other forms/units >>

Yes, if there is more than one TPage components they must have distinct
names.

--
Fernando Dias
[Team Elevate]
Image