USING System.Windows.Forms.* FROM ASSEMBLY.
DEFINE VARIABLE myControls AS CLASS Control+ControlCollection NO-UNDO. DEFINE VARIABLE myForm AS CLASS Progress.Windows.Form NO-UNDO. DEFINE VARIABLE myButton AS CLASS Button NO-UNDO. ASSIGN myForm = NEW Progress.Windows.Form( ) myButton = NEW Button( ) myButton:Text = "Ok". /* Controls property references a ControlCollection object */ myControls = myForm:Controls. myControls:Add(myButton). |
IF myControls:Contains(myButton) THEN
MESSAGE "myControls has a myButton object" VIEW-AS ALERT-BOX. |
MESSAGE "myControls has " myControls:Count " objects." VIEW-AS ALERT-BOX.
|
MESSAGE "Control #0 Text: " myControls[0]:Text VIEW-AS ALERT-BOX.
|
IF myControls.Contains (myButton) THEN
myControls:Remove(myButton). MESSAGE "myControls has " myControls:Count " objects." VIEW-AS ALERT-BOX. |