Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Containers into a Form - Please Help!
Message
From
29/05/2001 05:17:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/05/2001 04:49:50
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00512094
Message ID:
00512098
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I'm dumb in OOP but I have to work on it now ;-( *sigh*
>
>I have a form. I need to write a program to add some container objects into it(number of containers is depends on the form size), where each container contains another 3 textbox objects. All needs to be defined in runtime except the form itself. The content of the textboxs also needs to be updated every 5 seconds(so have to consider the ControlSource)..
>
>I have made some simple code for practice, trying to add a label object into the form, but still fail :-(
>
>this is my code:
>
>  do form main && created in project
>  main.addobject("Label_1", "RM_TYPE")
>  main.show
>
>  define class RM_TYPE as label
>    Procedure init
>      This.Caption = "Testing"
>    Endproc
>  enddefine
>
>
>What should I do?
>
>Also, is it possible to use "AddObject()" command in the Form's event codes(such as Init, load, activate... etc.)?
>
>I'm having serious problem now, any help would be greatly appreciated.. Thank you very mcuh!!

Hi again Jimi,
First stop flaming yourself. None of us born OOPed :)
Jimi, all you need was a :
main.Label_1.visible = .T.
Never forget, to prevent discrepencies VFP automatically sets visible to .F. for newly added objects.

And as another note remember with the style you used 'main' would always point to the first instance of that form.
CEtin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform