Public oForm oForm = Createobject('sampleForm') oForm.Show() Define Class sampleform As Form Height=600 Width = 800 Add Object myButton As CommandButton With Caption="Create Grid" Add Object myContainer As Container With Top=30,Height=770,Width=800, Anchor=15 Procedure myButton.Click Thisform.myContainer.Newobject("myLocator","locatorgrid", "d:\foxyclasses\classes\grids.vcx","",; "* from (_samples+'data\customer')") With Thisform.myContainer.myLocator .Height = Thisform.myContainer.Height .Width = Thisform.myContainer.Width .Anchor = 15 .Visible = .T. Endwith Endproc Enddefine