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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Container on forms?

Status
Not open for further replies.

Keepontrying

Programmer
May 12, 2003
67
US
How can I interactively drop container store in a class to a form. So based on the user selection cetain containers will be used

Thanks for any input.
 
x = CREATEOBJECT('form')
x.Show
x.AddObject('MyContainer','container')
x.MyContainer.visible = .t.

This creates a form and adds a container. In your specific instance - you need to replace 'container' with the name of the container you wish to add from your classlib, and adjust its positioning, etc.



Jim Osieczonek
Delta Business Group, LLC
 
Jim,
Thank you for your reply. Any information about replacing the container with another?

Example
container 1 is currently displaying on the form
user click on a option
container 1 is now replace with container 2

so if this possible how will I do this?

Thanks for any input
John
 
Hi JOhn,

YOu can drop a container with the code..

ThisForm.RemoveObject(myContainer)

and you can add another with the above code suggested.

HOwever, you can also think of putting all the containers in the form and making their VISIBLE = .f. by default. Then based on whatever user choice, make the relevant containers visible = .t.

:)




____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
Merry Christmas & Happy New Year
 
Just to add to ramani's reply.

I once wrote an application that displayed questions on a form. The questions were table driven and could be different types. (combo box, option groups, check box, text, etc.)

Obviously, this could get out of control after answer just a few questions. Therefore, I saved the name of the control(s) into an array property on the form. Before building the next question, I had to destroy the prior question (object) using ramani's suggestion, but tweaked to include the value in the array.

ThisForm.RemoveObject(Thisform.myContainerArray)


Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top