Board index » delphi » Disabling or hiding pages in a Tabbed Notebook

Disabling or hiding pages in a Tabbed Notebook

I suspect the answer is no, but I'll ask the question anyway:

Is there a way to temporarily hide or disable a page in a
tabbed notebook without destroying and having to recreate
all the controls on the page?   I.e. The page and its tab should
either become invisible or the font on the particular tab should
appear grayed and unselectable.  Under software control,
the page must then be able to reappear as normal.

Or perhaps someone has developed a component where this
is possible.

TIA,

Michael

 

Re:Disabling or hiding pages in a Tabbed Notebook


Quote
mb...@magi.com (Michael Bein) wrote:
>I suspect the answer is no, but I'll ask the question anyway:
>Is there a way to temporarily hide or disable a page in a
>tabbed notebook without destroying and having to recreate
>all the controls on the page?   I.e. The page and its tab should
>either become invisible or the font on the particular tab should
>appear grayed and unselectable.  Under software control,
>the page must then be able to reappear as normal.
>Or perhaps someone has developed a component where this
>is possible.
>TIA,
>Michael

Addendum:

I should have stated I am using Delphi 1.0.

M

Re:Disabling or hiding pages in a Tabbed Notebook


I believe that the only way to do this is to use a Notebook and
separate Tabset component.  Then you change the Tabset tabs to display
only the visible pages.  Name the Tabset Tabs the same as the Notebook
pages.  When you click on the Tabset use the name on the tab to change
the ActivePage in the Notebook.   I have used this technique and it
works well.  The only difference is that the Tabset component places
tabs at the bottom instead of the top.

Wayne Boyte

Re:Disabling or hiding pages in a Tabbed Notebook


Thanks for the suggestion.  Sounds like a good idea.

Unfortunately I've already got two rows of Tabsets at the bottom of
the form and for stylistic reasons need to use TabbedNotebook-style
tabs at the top.

Michael

bwbo...@nash.mindspring.com (Billy Wayne Boyte) wrote:

Quote
>I believe that the only way to do this is to use a Notebook and
>separate Tabset component.  Then you change the Tabset tabs to display
>only the visible pages.  Name the Tabset Tabs the same as the Notebook
>pages.  When you click on the Tabset use the name on the tab to change
>the ActivePage in the Notebook.   I have used this technique and it
>works well.  The only difference is that the Tabset component places
>tabs at the bottom instead of the top.
>Wayne Boyte

Re:Disabling or hiding pages in a Tabbed Notebook


You could use a false Tabnotebook at the top for tabs.  Then use a
notebook underneath the Tabnotebook.  Size the tabnotebook so that
only the tab show.  Then use can add to the pages of the tabnotebook.
This is a long way to get there but it works.  I used this before I
switched to the tabset.

Wayne Boyte

Re:Disabling or hiding pages in a Tabbed Notebook


Quote
Michael Bein wrote:

> I suspect the answer is no, but I'll ask the question anyway:

> Is there a way to temporarily hide or disable a page in a
> tabbed notebook without destroying and having to recreate
> all the controls on the page?   I.e. The page and its tab should
> either become invisible or the font on the particular tab should
> appear grayed and unselectable.  Under software control,
> the page must then be able to reappear as normal.

> Or perhaps someone has developed a component where this
> is possible.

> TIA,

> Michael

I am now using D2 exclusively, but did solve your problem ages ago...if
I remember correctly there is an event in the tabbed notebook which
notifies you of an impending change of tabs.  It contains a var
parameter called AllowChange which you can set to false.  As to graying
out the tab, try overriding the Paint method of the notebook.  Don't
forget to call inherited Paint first!

Re:Disabling or hiding pages in a Tabbed Notebook


In article <4ug557$...@news.istar.ca>, mb...@magi.com says...

Quote

>I suspect the answer is no, but I'll ask the question anyway:

>Is there a way to temporarily hide or disable a page in a
>tabbed notebook without destroying and having to recreate
>all the controls on the page?   I.e. The page and its tab should
>either become invisible or the font on the particular tab should
>appear grayed and unselectable.  Under software control,
>the page must then be able to reappear as normal.

>Or perhaps someone has developed a component where this
>is possible.

>TIA,

>Michael

I know there's a property in the tabs of a PageControl-component (Delphi 2)
that hides a tab. It's called TabVisible in the TTabSheet-class.

Hope that helps.

Other Threads