I haven't been here for a long time because of my busy work.
In MS WebMatrix, a new event is added to Form: InitActivated. This code is detected, and it is only a special case of Form Activated events, this event is triggered when Activated is triggered for the first time. The Code is as follows:
If (! This. _ initActivatedRaised)
{
This. _ initActivatedRaised = true;
This. OnInitActivated (e );
}
This code is very practical and solves the problem that I used to wait for all the content of the form to be loaded and the processing code must be placed in OnLoad (it is inconvenient to put it in OnLoad, there are many unexpected problems, which are annoying ).
Recently, it was found that this desire was lost, that is, the InitActivated event was triggered before the Load event. He discussed with his colleagues that there was no problem.
I found a new weird problem later: I showed a Dialog in the InitActivated event and found that if the form is normal, the initialization content of the form has been loaded (as shown on the interface ), if the status is maximized, it is not.
Therefore, we track OnInitActivated and OnLoad and find that in normal state, OnLoad is executed first and then in maximized state.
Ms form policy !!!