Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PageFrame

Status
Not open for further replies.

foxfire

Programmer
May 18, 2001
38
US
I want to change the font size and bold the title of the active page in a page frame. I put the following in the refresh:
FOR MyPageCount=1 TO thisform.PageFrame1.PageCount
thisform.PageFrame1.Pages(MyPageCount).refresh
thisform.PageFrame1.Pages(MyPageCount).FontBold=(thisform.PageFrame1.ActivePage=MyPageCount)
thisform.PageFrame1.Pages(MyPageCount).FontSize=IIF(thisform.PageFrame1.ActivePage=MyPageCount,14,10)
NEXT

All worked well until I changed the order of the pages. It seems ActivePage returns the relative order of the page and Pages(MyPageCount) refers to the actual order the pages were added to the pageframe. I can find where I can change how the pageframe refers to the pages by number with respect to the pages() array. Any ideas or alternate solutions would be appreciated. Thanks
 
Put code such as the following into the activate event of each of your pages (modify to suit - such as fontsize)...

Code:
thisform.LockScreen = .t.
THIS.Parent.Setall("Forecolor", 0, "Page")
THIS.Forecolor = 16711680
THIS.Parent.Setall("Fontbold", .F., "Page")
THIS.Fontbold = .T.
thisform.LockScreen = .f.

boyd.gif

 
If you had a page class you were using then you could just add it to your subclass and all instances of those pages would inherit it... that would be the correct way to do this. It would also allow you to reuse that page class in subsequent projects - maintainability and reuse are always good things.

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top