OnActivate when form's parent is another form

I have dll forms that are opened within a main form in a right panel.  The dll forms parent is set to the main form's right panel. The dll's form's parent TWinControl is transferred to the main form via a parameter in the exporting procedure. I want to connect to a database and load data in the dll forms FormActivate, but when the dll is opened its FormActivate is never triggered. I tried forcing FormActivate in the dll's exporting prodecure right after showing the form by adding: SendMessage(DLLFormName.handle, WM_ACTIVATE, WA_ACTIVE,0); but this gave me an error "Cannot focus a disabled or invisible window". Is there no way to still access the dll form's onactivate when the form's parent is another form?
CilicianAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CilicianAuthor Commented:
Setting the form's ActiveControl property to anything on the form gets rid of the "Cannot focus a disabled or invisible window".  but the form's OnActivate is still not triggered.
0
CilicianAuthor Commented:
Well I found a solution. OnActivate was triggered when I called it from OnShow with DLLFormName.OnActivate(Sender); Beats me as to why OnActivate isn't triggered otherwise.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.