Active Pageframe Page (from vfug newsletter)

After spending several long evenings it became apparent that there was no good way to tell what page in a PageFrame was active from outside the PageFrame.I know you have PageFrame.activepage, PageFrame.tabindex, you have the objects and the pages collection to look at. But, if your pages change based upon selections that the user makes such as Security setting, If the pages get rearranged, there is no good way to tell what page you're on. The ActivePage and TabIndex properties tell you the number of the page starting from the left. This however is not necessarily the object or page number in the object and page collections.

So after a bit of thought, a simple solution, I created my own PageFrame Subclass.

Make the page count 0. If you include any pages in your subclass, you can't rename them in the object once placed on a form. I happen to like names a bit more descriptive than "Page1", and "Page2" - they sound like something out of Doctor Suess.

Then create a property called "ActivePageName" and set it's default value to (None) instead of .f. Otherwise if you try to check your property before the pageFrame becomes "Active" (not initialized), you will get an error.

Now each time you add a page, simple put the line.

This.Parent.ActivePageName = This.Name

In the activate event of each page.

Why Microsoft doesn't give us such a property I don't know, but it saves lots of headaches.

Jay Hudson  Jay@isasi.com

Commentaar van anderen:
ChristianLouboutin op 18-8-2010 om 3:47
Christian Louboutin Shoes, Christian Louboutin Shoes, Christian Louboutin, Wedding Shoes, Christian Louboutin The luxury Replica Watches is called a luxury because of its limited number of limited edition hand-made and a long period. Christian Louboutin Shoes, Wedding Shoes, Discount Christian Louboutin, Louboutin Shoes, Christian Louboutin Sale because it had these features before they sparked the desire of customers to purchase financial writer Wu Xiaobo said that when living in an era of fear. Discount Christian Louboutin, Louboutin, Sale Christian Louboutin, Louboutin Sale, Chanel Shoes, Alexander Wang Shoes uncertainty is also a productivity less means scarcity, scarcity means that for less than the demand, Manolo Blahnik Shoes, Louboutin Sale the face of this situation a few first blessing up the idea because of all the bizarre transient also had a weird overlay acts it. Louboutin Shoes, Christian Louboutin Discount, Louboutin, Christian Louboutin Sale, Buy Christian Louboutin It is not hard to understand Christian Louboutin Pumps in Japan to open its first flagship store when the customer line from 3.2 kilometers of the singular scene, in fact line up is in itself a behavior so customers will be happy this endless. YSL Shoes, Herve Leger Dress, Herve Leger V Neck Dress, Herve Leger Bandage Dress, Herve Leger Dress, Herve Leger V Neck Dress ome people commented that the Japanese auto exports to earn the franc by the French only by a Christian Louboutin to easily recover the cost of coming.
Geef feedback:

CAPTCHA image
Vul de bovenstaande code hieronder in
Verzend Commentaar