Board index » delphi » Page Control: D2 - Disabling or hiding a page

Page Control: D2 - Disabling or hiding a page

How can I disable or hide a page in a PageControl component? I have
tried:

   PageControl1.Pages[2].Enabled := False;
and
   PageControl1.Pages[2].Visible := False;
and
   TabSheet2.Visible := False;
and
   TabSheet2.Enabled := False;

None of these seem to do anything. Please help.

thans
Abel

 

Re:Page Control: D2 - Disabling or hiding a page


Mister ABEL...
try this code...
TabSheet.TableVisible := False; { OFF }
....
...
...
TabSheet.TableVisible := True; { ON }

HOPE in advance.
ge...@twics.com
 Abel Mireles wrote in article <5qdopo$...@pulitzer.eng.sematech.org>...

Quote
>How can I disable or hide a page in a PageControl component? I have
>tried:

>   PageControl1.Pages[2].Enabled := False;
>and
>   PageControl1.Pages[2].Visible := False;
>and
>   TabSheet2.Visible := False;
>and
>   TabSheet2.Enabled := False;

>None of these seem to do anything. Please help.

>thans
>Abel

Re:Page Control: D2 - Disabling or hiding a page


On Mon, 14 Jul 1997 12:48:57 -0500, Abel Mireles

Quote
<Abel.Mire...@SEMATECH.ORG> wrote:
>How can I disable or hide a page in a PageControl component? I have
>tried:

>   PageControl1.Pages[2].Enabled := False;
>and
>   PageControl1.Pages[2].Visible := False;
>and
>   TabSheet2.Visible := False;
>and
>   TabSheet2.Enabled := False;

>None of these seem to do anything. Please help.

I haven't tried what you've described but if I were faced with this
problem, I'd do the following:

var TempSheet: TTabSheet;
.
.
procedure TForm1.HideSheet(PageNo: integer);
begin
        TempSheet := PageControl1.Pages[1];
        TempSheet.PageControl := nil
end;

procedure TForm1.ShowSheet;
begin
        TempSheet.PageControl := PageControl1
end;

If I had to hide more than one TTabSheet at a time, I'd make TempSheet
a TList. TempSheet serves only as a reminder of where (in memory) the
hidden TTabSheet is. Setting its PageControl property adds it back to
the TPageControl.

Simple stuff.

--
Mauri...@bellsouth.net

Programming is an art form that fights back.

Other Threads