FOR EACH loControl IN thisform.objects
IF LOWER(loControl.baseclass) = 'command'
ENDIF
ENDFOR
>Hi,
>Is there a way to loop through all of the command buttons on a form? I have a command button
>on a form that creates and puts other command buttons on this form, Button_1, Button_2, etc.
>However, when I try to remove these buttons -- clicking another command button labeled "remove
>buttons", I get a message that button_1 does not exist, even though I still can see it
>on the form.
>
>I would have thought that this would work. Each button_1 ... is an instance on the
>class called MyDate, a command button.
>
>
>IF PEMSTATUS(m.THISFORM, "Button_1" , 5)
> thisForm.RemoveObject("Button_1","MyDate")
>ENDIF
>
>
>Thanks
>Steve