Occurs when creating a Template.
In Windows Forms applications, this event is raised when a Window is created. Handle this event to create a custom Template for this Window. For this purpose, use the handler's CreateCustomTemplateEventArgs.Context parameter to create a custom Template for a particular context. For details, refer to the Template Customization, How to: Create a Custom WinForms Ribbon Template and How to: Create a Custom WinForms Standard Template topics.
In ASP.NET Web applications, Templates represent pages that implement the IFrameTemplate or IWindowTemplate interface. If a page, which is being loaded, does not implement one of these interfaces, the CreateCustomTemplate event is raised. Handle this event, to create a Web control that implements the IFrameTemplate or IWindowTemplate interface.