For example, the code below will do nothing in the default case. It will work fine after you apply the work-around mentioned later on.
var ParentForm: TCustomForm; begin ParentForm := GetParentForm(Self); ParentForm.ActiveControl := Edit1; end;
The bad behavior is also apparent when using TPageControl, since TPageControl.ChangeActivePage tries to set the ActiveControl when changing pages.
The simple work-around for this is to call the following in your ActiveForm code:
PostMessage(Handle, WM_ACTIVATE, WA_ACTIVE, 0); Since I use PARAM tags in my OBJECT tag to pass parameters, I am doing this in IPersistPropertyBagLoad method after creating my Delphi form. After doing this, everything is working great. Thanks to Steve Trefethen for listening to my original vent.
Thanks to Steve Trefethen for listening to my original vent.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.