Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying Conditional Container
Message
 
To
19/07/2001 10:59:36
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00532576
Message ID:
00532608
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>I want to have a portion of a form that changes depending on a condition whenever refreshed. Can I create different containers as classes and then call the one I want to display somehow during runtime? I'm trying to avoid having multiple containers that will occupy the same space on my form in development. Thanks!


To add on Stephen's suggestion. This is what I do in some cases. I create a "page" (container object) per condition I need, and then on the main form have the page frame (no tabs and border) with the number of pages as I have conditions. Then when a condition comes up (like in my case a selection from a treeview) I call following code:
LPARAMETERS pnPage

local laPage(10), lcPage, loPage
*!* Which container from my class library depending on which page
laPage(1) = "if_about"
laPage(2) = "if_folder"
laPage(3) = "if_er"
laPage(4) = "if_eex"
laPage(5) = "if_sch"
laPage(6) = "if_inq"
laPage(7) = "if_enr"
laPage(8) = "if_cust"
laPage(9) = "if_settings"
laPage(10)= "if_log"

lcPage = "thisform.pIflex.page"+allt(str(pnPage))
loPage = &lcPage
lcPage = lcPage + ".oPage"

if type(lcPage) = "U" then
    *!* Container doesn't exists, add it
	loPage.addobject("oPage", laPage(pnPage))
	loPage.oPage.left = 0
	loPage.oPage.top = 0
	loPage.oPage.visible = .T.
	loPage.oPage.refresh()
endif
thisform.pIflex.activepage = pnPage
HTH,
- Erik Niese-Petersen

Crazy Dane in USA.
Previous
Reply
Map
View

Click here to load this message in the networking platform