* C5.prg close all release all clear all public frmC5 frmC5=createobject('subform') frmC5.Show read events cancel procedure RemoveSmallContainer(loForm,locntBig,locntSmall) * To generate a C5 error, comment the line "loForm.txtFocus.setfocus" * (below) and rerun loForm.txtFocus.setfocus locntSmall.Visible=.f. locntBig.RemoveObject('cntSmall') messagebox([Small Container Removed]) endproc define class subBigContainer as container left=10 top=10 backcolor=rgb(255,255,255) add object lblName as label lblName.caption=[Big Container] add object cntSmall as subSmallContainer cntSmall.height=this.height-30 enddef define class subSmallContainer as container left=20 top=20 backcolor=rgb(0,0,255) add object lblName as label lblName.caption=[Small Container] add object cmdRemoveObj as subRemoveObj enddef define class subRemoveObj as commandbutton top=30 left=30 width = 140 fontsize=8 fontname=[Arial] caption=[Remove Small Container] procedure click RemoveSmallContainer(this.parent.parent.parent,this.parent.parent,this.parent) endproc enddefine define class subForm as form name='frmC5' backcolor=rgb(255,0,0) autocenter=.t. procedure queryunload clear events endproc add object txtFocus as TextBox txtFocus.width=1 txtFocus.height=1 txtFocus.borderstyle=0 txtFocus.backstyle=0 add object cntBig as subBigContainer cntBig.width=this.width-30 && This parent is the form cntBig.height=this.height-30 enddefine * END C5.PRG