.disableChildren .origDisabledChildren .enabled_assignAdd the following code to the .enabled_assign method:
Lparameters vNewVal *To do: Modify this routine for the Assign method With This If m.vNewVal ** We are enabling If .disableChildren ** This will change the enabled state of all the ** child controls. You can disabled this behaviour ** by setting the .DisableChildren property to .F. ** Enabled everything first For Each oControl In .Controls If PemStatus(oControl, "Enabled", 5) oControl.Enabled = .T. Endif Next ** Disable any of the stored kids. If .origDisabledControls[1] = .T. Local j For m.j = 2 To Alen(.origDisabledControls) .origDisabledControls[m.j].Enabled = .F. Next Endif Endif Else ** We are disabling If .disableChildren ** spin through the kids and build an array of any ** that are disabled. Local oControl, i m.i = 1 Dimension .origDisabledControls[1] ** The first element of the is a flag to determine ** if the array is empty .origDisabledControls = .F. For Each oControl In .Controls If PemStatus(oControl, "Enabled", 5) If Not oControl.Enabled .origDisabledControls[1] = .T. Dimension .origDisabledControls[ Alen(.origDisabledControls) + 1 ] m.i = m.i + 1 .origDisabledControls[m.i] = oControl Endif Endif Next ** Ok, now just changed the enabled status of the kids For Each oControl In .Controls If PemStatus(oControl, "Enabled", 5) oControl.Enabled = .F. Endif Next EndIf Endif .Enabled = m.vNewVal Endwith>> ...