>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
> 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