Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PageFrame. Hiding Pages (VFP 6)

1,189 views
Skip to first unread message

Demetrios Panayiotakopoulos

unread,
May 5, 2004, 7:28:01 AM5/5/04
to
Hi,

Is there a way to hide pages in a page frame.
I have a pageframe with 5 pages. In some cases I want to hide the three of
them.

The only thing I managed is to:
1. Clean the caption for those 3 pages.
2. Re-arrange the order, by moving the 3 unwanted pages at the end of the
page frame.
3. Disable them, so the user will not have access.

But I do not like the aesthetic result.

Demetrios, Greece


<rush.strong]@[verizon.net>

unread,
May 5, 2004, 10:02:52 AM5/5/04
to
How 'bout using two pageframes, one on top of the other? One would have 3
pages, one would have all 5, and you would bring the desired pageframe on
top of the other. You could design the full pageframe in the form designer
and then write a custom method to replicate it, less the unwanted pages, and
run that code from the form's .init.

- Rush

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr>
wrote in message news:OLNXlRpM...@TK2MSFTNGP09.phx.gbl...

Stefan Wuebbe

unread,
May 5, 2004, 10:18:44 AM5/5/04
to
I think you cannot hide the pages. What do you think about
using AddObject and RemoveObject, respectively altering
.PageCount at runtime.
You could define separate page classes, or containers to be
add to the pages (and that way maybe even get some speed
improvement by adding only those pages you want at runtime,
similar to the concept of "delayed instantiation").


hth
-Stefan

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr> schrieb im
Newsbeitrag news:OLNXlRpM...@TK2MSFTNGP09.phx.gbl...

Rick Bean

unread,
May 5, 2004, 10:18:15 AM5/5/04
to
Demetrios,
Besides Rush's idea, you could create a PageFrame with no tabs, and then add labels, shapes or buttons to select the pages you want (in thier click event). You make these appear and disappear depending on the sitiuation, or you cild just use 'next' 'previous' and just skip the hidden ones when necessary!

Rick

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr> wrote in message news:OLNXlRpM...@TK2MSFTNGP09.phx.gbl...

Demetrios Panayotakopoulos

unread,
May 5, 2004, 12:28:01 PM5/5/04
to
Rick,

I have to try it to see how it looks.
Not a bad idea if it looks OK.

Thanks,
Demetrios, Greece

"Rick Bean" <rgb...@unrealmelange-inc.com> wrote in message
news:uSLePvq...@tk2msftngp13.phx.gbl...

Demetrios Panayotakopoulos

unread,
May 5, 2004, 12:31:04 PM5/5/04
to
Stefan,

I will have to examine this option too.
I am not sure if the trouble would be worth-while.
I wonder if this is possible in VFP 8, or the option to have the tabs in
other directions, vertical or at the bottom.

Thank you.

Demetrios, Greece

"Stefan Wuebbe" <stefan...@gmx.de> wrote in message
news:OAS$AvqME...@TK2MSFTNGP10.phx.gbl...

Demetrios Panayotakopoulos

unread,
May 5, 2004, 12:27:55 PM5/5/04
to
Rush,

Well, this would overload the form.
The two of the pages, have plenty of textboxes.
Thanks anyway.
From the answers I see that there is no built-in way to do it

Demetrios, Greece

"Rush Strong" <rush.strong]@[verizon.net> wrote in message
news:%23bl0Zmq...@TK2MSFTNGP10.phx.gbl...

Trey Walpole

unread,
May 5, 2004, 12:48:39 PM5/5/04
to
No hiding pages (e.g., page.visible=.F.) in vfp8.

However ---
you can visually design a Page class and use Stefan's suggestion more
easily.

VFP8 has tab orientation settings as well

"Demetrios Panayotakopoulos" <dpan__dp@_ath.forthnet.gr> wrote in message
news:e$GV95rM...@tk2msftngp13.phx.gbl...

Demetrios Panayotakopoulos

unread,
May 5, 2004, 2:48:44 PM5/5/04
to
Thank you Trey.

Demetrio, Greece

"Trey Walpole" <treyN...@SPcomcastAM.net> wrote in message
news:e%230zdDsM...@TK2MSFTNGP09.phx.gbl...

Christian Desbourse

unread,
May 5, 2004, 4:58:01 PM5/5/04
to
In article <OLNXlRpM...@TK2MSFTNGP09.phx.gbl>, Demetrios
Panayiotakopoulos wrote:
> Is there a way to hide pages in a page frame.
> I have a pageframe with 5 pages. In some cases I want to hide the three of
> them.
>

If you add a RETURN .F. in the init() method of the page you don't need, it
will not be instantiated.

Example :

IF oUser.GetSecurityLevel("PART_COST") < 1
RETURN .F.
ENDIF

Page numbering remains the same for the other pages.

Christian Desbourse (Belgium)
http://www.cdesbourse.com

Anders Altberg

unread,
May 5, 2004, 6:48:49 PM5/5/04
to
You could use a container with five labels. When a label is clicked you do
add a container class with your controls on it. When the next label is
clicked you RemoveObject and AddObject to show another container from your
class library. You can set the label.visible=.F. when you need to hide a
'page'. You can also make these containers visible or not as needed instead
of removing and adding them.
-Anders

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr>
wrote in message news:OLNXlRpM...@TK2MSFTNGP09.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 1:51:45 AM5/6/04
to
Christian,

I did try it, but if failed.
Are you sure this can be done?

Demetrios, Greece


"Christian Desbourse" <c...@cdesbourse.com> wrote in message
news:VA.000001c...@cdesbourse.com...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 1:55:05 AM5/6/04
to
Anders,

Thanks for the suggestion.
Unfortunately, all these are tricks / work arounds,
in order to do something that should have this ability.

Demetrios, Greece

"Anders Altberg" <x_pr...@telia.com> wrote in message
news:eDz6gUvM...@TK2MSFTNGP12.phx.gbl...

Anders Altberg

unread,
May 6, 2004, 4:30:36 AM5/6/04
to

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr>
wrote in message news:O3RYM8yM...@TK2MSFTNGP12.phx.gbl...

Anders Altberg

unread,
May 6, 2004, 4:52:42 AM5/6/04
to
>>in order to do something that should have this ability
In your dreams buddy. <s>. Let's see what can be done in VFP 6..
As of VFP8 there's a Member class object (Page) for the Pageframe container
and a MemberClass and MemberClassLib properties., but you still need a
container with objevcts to place on the page, or a subclass for each page.
VFP8 also adds a TabOrientation property.
Something can be done with the TabStyle prop to push Pages with no caption
outside the pageframe.
Swapping container objects is splitsecond in my experience.
-Anders

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr>
wrote in message news:O3RYM8yM...@TK2MSFTNGP12.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 5:55:34 AM5/6/04
to
Anders,

Please do not spoil my dreams :-)
Thanks again.

Demetrios, Greece


"Anders Altberg" <x_pr...@telia.com> wrote in message

news:eeeVCd0M...@TK2MSFTNGP11.phx.gbl...

Leonid

unread,
May 6, 2004, 7:10:37 AM5/6/04
to
May be you can simly remove unwanted pages in form's Init method

Thisform.MyPageFrame.RemoveObject("Page2")

Of course in this case you can't "unhide" it before closing form

Leonid

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr> wrote in message news:OLNXlRpM...@TK2MSFTNGP09.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 9:04:46 AM5/6/04
to
Leonid,

I do not want to remove the pages.
The user in the specific form should be able to enable or disable pages of
of the pageframe interactively according to the "type of patient's card" he
is handling..

So many people trying to solve this problem.
Thank you guys.

Demetrios, Greece

"Leonid" <leonid@REMOVE_CAPS_AND_INVALIDgrada.lv.invalid> wrote in message
news:O$RMCq1ME...@TK2MSFTNGP11.phx.gbl...

Leonid

unread,
May 6, 2004, 9:37:28 AM5/6/04
to
May be you can use pageframe without tabs use commandbuttons instead of tabs

Leonid

"Demetrios Panayiotakopoulos" <dpanayiotakopoulos_my_dat@_my_ametro.gr> wrote in message news:ubCZSs2M...@TK2MSFTNGP10.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 9:49:25 AM5/6/04
to
Rick,

I investigate the Tabstrip.control, which is not a control and can use it
instead of buttons or shapes.
Demetrios, Greece

"Rick Bean" <rgb...@unrealmelange-inc.com> wrote in message
news:uSLePvq...@tk2msftngp13.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 10:02:02 AM5/6/04
to
I tried TabStrip control.
unfortunately the Help does not fully work.

I can add TABS with:
ThisForm.TabStrip.Tabs.Add

Better !!! adds Nth TAB
ThisForm.TabStrip.Tabs.Add[n]

It took me many tries to find that command to remove a tab is
ThisForm.TabStrip.Tabs.Remove[n]

Demetrios, Greece

that


"Leonid" <leonid@REMOVE_CAPS_AND_INVALIDgrada.lv.invalid> wrote in message

news:#mmqF82M...@TK2MSFTNGP10.phx.gbl...

Demetrios Panayiotakopoulos

unread,
May 6, 2004, 10:21:40 AM5/6/04
to
The aesthetic result of TaBstrip and PageFrame combination is not bad.
And we can have Tabs On Top, Bottom, left, Right.

The problem may be solved using the TabStrip control
in conjuction with PageFrame with Tabs set to .F.

It is possible to add or remove tabs in the TabStrip.
I finally found and the folowing in the manual.

Tabs Collection
A Tabs collection contains a collection of Tab objects.

Syntax
tabstrip.Tabs(index)
tabstrip.Tabs.Item(index)

.. Add - adds Tab objects to the TabStrip control.
.. Item - retrieves the Tab identified by its Key or Index from the
collection.
.. Clear - removes all Tab objects from the collection.
.. Remove - removes the Tab identified by its Key or Index from the
collection

ThisFormTabStrip.SelectedItem.Index will be used to enable the appropiate
Page of the PageFrame

Demetrios, Greece


"Leonid" <leonid@REMOVE_CAPS_AND_INVALIDgrada.lv.invalid> wrote in message

news:#mmqF82M...@TK2MSFTNGP10.phx.gbl...

Christian Desbourse

unread,
May 6, 2004, 9:45:20 PM5/6/04
to
In article <OBvTV6yM...@TK2MSFTNGP12.phx.gbl>, Demetrios
Panayiotakopoulos wrote:
> I did try it, but if failed.
> Are you sure this can be done?
>

Yes, definitely

Try with a simple example.
Build a new form, add a pageframe and set page count to 5
In the init of page 2 and 4 add RETURN .F.
Execute the form and you will see a pageframe with pages 1,3,5

Demetrios Panayotakopoulos

unread,
May 7, 2004, 12:36:49 AM5/7/04
to
Christian,

I would swear that it didn't work in my first test.
I did test it with a simple example, but used an "if" statement in the init
method.
That was the problem at the first time that led me to incorrect
conclussions.

The init method is executed once when the form is initiated.

It is true. When the form starts the page dissapears (gone).
But, there is no way to bring it back in the same form.

In my case the problem remains.
I can not arbitrary hide and unhide pages.

As Trey wrote, this is also not supported in VFP 8.
So I will have to use the TabStrib in conhuction with PageFrame (where
Tabs=.F.)

TabStrip is found in MSCOMCTL.OCX ( I think)
Do you know what is that is installed in each computer. Once by mistake I
replaced it in a computer and I think that due to that it started been
unstable.

Thanks again all of you.
Demetrios, Greece


"Christian Desbourse" <c...@cdesbourse.com> wrote in message
news:VA.000001c...@cdesbourse.com...

0 new messages