Board index » delphi » Delphi2-Get active TTabSheet of TPageControl

Delphi2-Get active TTabSheet of TPageControl

Hi,

In Delphi2, I dropped a TPageControl control onto a form and
created 2 pages with Name property Page1 and Page2 (of TTabSheet)
via the menu options using the right mouse button. This already
took me quite a while to figure out as it is as simple as creating
the pages via the Strings property under Delphi-1.

The problem now is to programmatically identify the different
TTabSheet objects that are active within the TPageControl object.
I looked through the on-line VCL help (warning: one must use
the latest, although still not completed Mar 96, version of
the VCL help) but still cannot seem to figure out the correct
way to do this (doubt it is correct anyway):

    if TPageControl1.Pages[0].Name = Page1

or even the PagesIndex property.

Is there a more straight forward and direct way to identify
the active TTabSheet object of the TPageControl object?

Help is greatly appreciated (with cc: to email address please).

Regards.
CL
4.29.96 @ 0058 hr sg.
.

 

Re:Delphi2-Get active TTabSheet of TPageControl


Quote
In article <4m07a5$...@raffles.technet.sg>, cl...@pacific.net.sg (cllee) wrote:
>Hi,

>In Delphi2, I dropped a TPageControl control onto a form and
>created 2 pages with Name property Page1 and Page2 (of TTabSheet)
>via the menu options using the right mouse button. This already
>took me quite a while to figure out as it is as simple as creating
>the pages via the Strings property under Delphi-1.

>The problem now is to programmatically identify the different
>TTabSheet objects that are active within the TPageControl object.
>I looked through the on-line VCL help (warning: one must use
>the latest, although still not completed Mar 96, version of
>the VCL help) but still cannot seem to figure out the correct
>way to do this (doubt it is correct anyway):

>    if TPageControl1.Pages[0].Name = Page1

>or even the PagesIndex property.

>Is there a more straight forward and direct way to identify
>the active TTabSheet object of the TPageControl object?

>Help is greatly appreciated (with cc: to email address please).

Check out the activepage property of the page control.

 - dave

Other Threads