CheckBox.CreateParams Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the required creation parameters when the control handle is created.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected override CreateParams CreateParams {
	[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
	get;
}

Property Value

Type: System.Windows.Forms.CreateParams

A CreateParams that contains the required creation parameters when the handle to the control is created.

The following code example extends the CreateParams property of a Button derived class. The CreateParams.Style property is changed, which causes the button to display an Icon rather than an Image. This example requires that you have a class that inherits from the Button class.

protected override CreateParams CreateParams
{
    get
    {
        new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();

        // Extend the CreateParams property of the Button class.
        CreateParams cp = base.CreateParams;
        // Update the button Style.
        cp.Style |= 0x00000040; // BS_ICON value

        return cp;
    }
}

SecurityPermission

for operating with unmanaged code. Associated enumeration: UnmanagedCode

.NET Framework
Available since 1.1
Return to top
Show: