Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I hate activate
Message
From
05/02/1999 15:22:38
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00183195
Message ID:
00184501
Views:
15
Hi Ken,
My initial message didn't make it.

As I understand it you need an event that will only fire when a PageFrame's ActivePage changes. I think I know how to create such an event. We can use VFP6's Access method to create a new event, call it NewPage. I would use ActivePage_Assign, unfortunately it is a documented bug that it will not fire when the user clicks on a new page. Instead we can use an ActivePage_Access method. VFP6 accesses a property before it changes it and at least in my version (only have beta where I am now) the ActivePage_Access method fires reliably.

Anyway:
Create a subclass of PageFrame
Add a CurrentPage property and initialize it to 0
Add a NewPage method
Add an ActivePage_Access method:
IF NOT This.CurrentPage = This.ActivePage
This.CurrentPage = This.ActivePage
This.NewPage()
ENDIF
RETURN THIS.ActivePage

I have tested this on my machine with two instances of a form class that has an instance of the new PageFrame subclass and it's NewPage method is called if and only if the ActivePage changes. In particular switching from one form or app to another does not fire it.

HTH,
Ned Ames
Ned

Reality is.
Previous
Reply
Map
View

Click here to load this message in the networking platform