Board index » delphi » How do I rotate screens?

How do I rotate screens?

    What I am refering to is something like many Windows setup programs or
Windows own internal config screens (like Add New Hardware).  Where when you
hit the Next button, the contents change but it's still the same form.  How
does one go about doing this?  If I could disable the tabs on a
TPageControl, that would give me the multiple pages to flip through but I
couldn't find a way to do it.

Thanks,
Sean

 

Re:How do I rotate screens?


If I understand you correctly, you want to make the
background form a static entity with changing
contents, correct ?  If so then you *can* create
the objects dynamically instead of defining them
at design time.  The easiest way to do it is to
design them, copy the object properties from the
form view in text mode, then assign these values
to a dynamically created component at runtime.
I haven't done this much in Delphi, but it's common
enough practice in C.

-------------------------------------------------------------------
"If you think you know the answer,
then you don't understand the question !"
-------------------------------------------------------------------

Quote
Sean Capstick <nospam.scapst...@home.com> wrote in message

news:I0Mp4.42008$45.2234399@news2.rdc1.on.home.com...
Quote
>     What I am refering to is something like many Windows setup programs or
> Windows own internal config screens (like Add New Hardware).  Where when
you
> hit the Next button, the contents change but it's still the same form.
How
> does one go about doing this?  If I could disable the tabs on a
> TPageControl, that would give me the multiple pages to flip through but I
> couldn't find a way to do it.

> Thanks,
> Sean

Re:How do I rotate screens?


I believe you want to make a "Wizzard" (a form with "Previous", "Next" and
"Finish" buttons).
You can indeed use the TPageControl. You have to disable the ShowTab's of
the pages:

  { in OnCreate() of your form }
  With PageControl1 do
    for i:=0 to PageCount-1 do Pages[i].TabVisible:=False;

You can now select the first page by using:

{ in OnShow() of your form }
  SelectPage(0);

I think you can figure out the code for the Next and Previous buttons
yourself.

Hope it helps,
  Erwin

Quote
"Sean Capstick" <nospam.scapst...@home.com> wrote in message

news:I0Mp4.42008$45.2234399@news2.rdc1.on.home.com...
Quote
>     What I am refering to is something like many Windows setup programs or
> Windows own internal config screens (like Add New Hardware).  Where when
you
> hit the Next button, the contents change but it's still the same form.
How
> does one go about doing this?  If I could disable the tabs on a
> TPageControl, that would give me the multiple pages to flip through but I
> couldn't find a way to do it.

Re:How do I rotate screens?


    Ah, thanks.  It's just what I wanted.

Sean

Quote
Erwin Molendijk <E.J.Molend...@student.utwente.nl> wrote in message

news:888m6g$9df$1@dinkel.civ.utwente.nl...
Quote
> I believe you want to make a "Wizzard" (a form with "Previous", "Next" and
> "Finish" buttons).
> You can indeed use the TPageControl. You have to disable the ShowTab's of
> the pages:

>   { in OnCreate() of your form }
>   With PageControl1 do
>     for i:=0 to PageCount-1 do Pages[i].TabVisible:=False;

> You can now select the first page by using:

> { in OnShow() of your form }
>   SelectPage(0);

> I think you can figure out the code for the Next and Previous buttons
> yourself.

> Hope it helps,
>   Erwin

> "Sean Capstick" <nospam.scapst...@home.com> wrote in message
> news:I0Mp4.42008$45.2234399@news2.rdc1.on.home.com...
> >     What I am refering to is something like many Windows setup programs
or
> > Windows own internal config screens (like Add New Hardware).  Where when
> you
> > hit the Next button, the contents change but it's still the same form.
> How
> > does one go about doing this?  If I could disable the tabs on a
> > TPageControl, that would give me the multiple pages to flip through but
I
> > couldn't find a way to do it.

Re:How do I rotate screens?


Hello Erwin,

I'm using Delphi 4 and I can't find the method SelectPage. The TPageControl
has a method named SelectNextPage(GoForward:boolean) that only switches
between TabSheets if ShowTab is true.

The only way to switch between the TabSheets is to set
PageControl.ActivePage to the TabSheet that should be selected.

Did you check your code ? If so, what version of delphi are you using ?

Michael Adamovic

Erwin Molendijk <E.J.Molend...@student.utwente.nl> schrieb in im
Newsbeitrag: 888m6g$9d...@dinkel.civ.utwente.nl...

Quote
> I believe you want to make a "Wizzard" (a form with "Previous", "Next" and
> "Finish" buttons).
> You can indeed use the TPageControl. You have to disable the ShowTab's of
> the pages:

>   { in OnCreate() of your form }
>   With PageControl1 do
>     for i:=0 to PageCount-1 do Pages[i].TabVisible:=False;

> You can now select the first page by using:

> { in OnShow() of your form }
>   SelectPage(0);

> I think you can figure out the code for the Next and Previous buttons
> yourself.

> Hope it helps,
>   Erwin

> "Sean Capstick" <nospam.scapst...@home.com> wrote in message
> news:I0Mp4.42008$45.2234399@news2.rdc1.on.home.com...
> >     What I am refering to is something like many Windows setup programs
or
> > Windows own internal config screens (like Add New Hardware).  Where when
> you
> > hit the Next button, the contents change but it's still the same form.
> How
> > does one go about doing this?  If I could disable the tabs on a
> > TPageControl, that would give me the multiple pages to flip through but
I
> > couldn't find a way to do it.

Other Threads