>* Test for William Benavente >* Save it to William.prg and run it (Ctrl+E) > >oForm = NewObject("TestForm" ) >oForm.show(1) > >oForm = NewObject("TestForm", "", "", "YourCustomContainer" ) >oForm.show(1) > > >Define Class TestForm As Form > > Autocenter = .t. > > Function Init( tcContainer as String ) as Boolean > > tcContainer = Iif( Empty(tcContainer), "YourBaseContainer", tcContainer ) > this.Caption = "Container: " + tcContainer > > this.NewObject( "testContainer", tcContainer, "William.prg" ) > this.testContainer.visible = .t. >EndDefine > > > >Define Class YourBaseContainer As Container > > Width = 200 > Height = 30 > > cLabelMember = "Label" > cLabelMemberClass = "" > cTextMember = "Textbox" > cTextMemberClass = "" > > Function Init() > this.NewObject( "lblMember", this.cLabelMember, this.cLabelMemberClass ) > this.NewObject( "txtMember", this.cTextMember, this.cTextMemberClass ) > > this.lblMember.Width = 80 > this.lblMember.Caption = "Something" > this.lblMember.Visible = .t. > this.txtMember.Left = 100 > this.txtMember.Width = 80 > this.txtMember.Visible = .t. > EndFunc > >Enddefine > >Define Class YourCustomContainer As YourBaseContainer > cLabelMember = "CustomLabel" > cLabelMemberClass = "William.prg" > cTextMember = "CustomTextbox" > cTextMemberClass = "William.prg" >Enddefine > >Define Class CustomLabel As Label > ForeColor = Rgb(255,0,0) >Enddefine > >Define Class CustomTextBox As TextBox > BackColor = Rgb(0,255,255) >Enddefine >>