pageframe::Init() *-- drop an instance of UIEnabler on each page LOCAL lnIndex FOR lnIndex = 1 TO This.PageCount This.Pages(lnIndex).AddObject("UIEnabler1", "UIEnabler") ENDFORThe UiEnable() code of my UiEnabler control is:
LPARAMETERS lEnable IF lEnable = LockScreen(.T.) This.Parent.Refresh() this.SetFocusToFirst() = LockScreen(.F.) ENDIFAnd the SetFocusToFirst() is:
*-- CHANGE - JCM - November 30, 1997 - 13:04:12 *-- inspiré de eBizObj.SetFocusToFirst() *-- permet d'avoir le focus sur le premier objet des criètres de recherche *-- mais sans effet sur les pages de cPageFrame1 LOCAL lnControl, ; llRetVal, ; lnTabIndex LOCAL lnControl, ; llRetVal, ; lnTabIndex *-- Sets focus to first control that is not disabled FOR lnTabIndex = 1 TO this.Parent.ControlCount FOR lnControl = 1 TO this.Parent.ControlCount IF TYPE("this.Parent.Controls(lnControl).TabIndex") <> "U" AND ; PEMSTATUS(this.Parent.Controls(lnControl), "SetFocus", 5) IF this.Parent.Controls(lnControl).TabIndex = lnTabIndex AND ; this.Parent.Controls(lnControl).Enabled this.Parent.Controls(lnControl).SetFocus() llRetVal = .T. EXIT ENDIF ENDIF ENDFOR IF llRetVal EXIT ENDIF ENDFOR RETURN llRetValI revisited my errorologs, and it was quite clear that the error was always coming from the first active control, so I simply removed the call to SetFocusToFirst() in the UiEnable() and the .EXE does not exhibit the error anymore. I'll try deeper tomorrow. But this seems to be the solution. Somehow, in Runtime mode, things are a bit different...