Event AfterLoaded

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

How can I catch the event of AfterLoad of the form?
I want to do something AFTER the form loaded and shown to user, how to do
this?
 
Found an answer:
For anyone interested : just override WndProc and override
WM_ACTIVATE
 
Hi Tamir,

I am glad you find what you want. But, I still want to add some information
for you. :-)

========================================================
The WM_ACTIVATE message is sent to both the window being activated and the
window being deactivated. If you want to determine it is activating or
deactivating, you should refer to this message's wParam, If the low-order
word of wParam is WA_INACTIVE, lParam is the handle to the window being
activated. If the low-order word of wParam is WA_ACTIVE or WA_CLICKACTIVE,
lParam is the handle to the window being deactivated.

For details, please refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference/Keyboar
dInputMessages/WM_ACTIVATE.asp

In .Net, the Form class has encapsulated this message, and already
distinguish it into 2 events, Form.Activated Event and Form.Deactivate
Event. I think, these 2 events may be more suitable for you. :-)

Also, you should be aware of that Activated event is not only fires after
the Load event, it occurs every time when the form is activated in code or
by the user. For more information, please refer it in your MSDN document.

=======================================================

Hope these help you. If you have further concern, please feel free to post,
I will work with you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top