Search code examples
formsfoxprovisual-foxpromouseclick-event

Foxpro form control "object not found" (but it existed in the form!)


I am trying to make a simple Form in Foxpro, I create the Form name form1, drag two CommandButton Command1 and Command2, In the Click event of Command1:

Command2.Visible = false

When I click, the Error message is: Object "Command2 cannot be found"

I worked in .Net so this is so strange


Solution

  • This.Parent.Command2.Visible = .f.
    

    or

    Thisform.Command2.Visible = .f.