System.Windows.Forms.NativeWindow.CreateHandle Method

Creates a window and its handle with the specified creation parameters.

Syntax

public virtual void CreateHandle (CreateParams cp)

Parameters

cp
A System.Windows.Forms.CreateParams that specifies the creation parameters for this window.

Remarks

The cp parameter specifies the values that are passed to the native Win32 CreateWindowEx method to create a window and its handle.

When the CreateParams.ClassName field is not null, the newly created window handle inherits from the specified class. For example, if CreateParams.ClassName is set to BUTTON, the newly created window is based on the Win32 BUTTON window class. The CreateParams.Param property of the CreateParams.ClassName object must either be null or reference an instance of a class that was declared as a structure.

This code is an excerpt from the example shown in the System.Windows.Forms.NativeWindow class overview. Some code is not shown for the purpose of brevity. See System.Windows.Forms.NativeWindow for the whole code listing.

Note:

   The class name provided is registered with the operating system.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0