Gets the required creation parameters when the control handle is created.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Protected Overridable ReadOnly Property CreateParams As CreateParamsprotected virtual CreateParams CreateParams { get; }protected:
virtual property CreateParams^ CreateParams {
CreateParams^ get ();
}abstract CreateParams : CreateParams
override CreateParams : CreateParamsProperty Value
Type: System.Windows.FormsA CreateParams that contains the required creation parameters when the handle to the control is created.
The CreateParams property should not be overridden and used to adjust the properties of your derived control. Properties such as the CreateParams
When overriding the CreateParams property in a derived class, use the base class's CreateParams property to extend the base implementation. Otherwise, you must provide all the implementation.
The following code example extends the CreateParams property of a Button derived class. The CreateParams
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
Get
Dim SecPerm As New SecurityPermission(SecurityPermissionFlag.UnmanagedCode)
SecPerm.Demand()
' Extend the CreateParams property of the Button class.
Dim cp As System.Windows.Forms.CreateParams = MyBase.CreateParams
' Update the button Style.
cp.Style = cp.Style Or &H40 ' BS_ICON value
Return cp
End Get
End Property
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;
}
}
virtual System::Windows::Forms::CreateParams^ get() override
{
// Extend the CreateParams property of the Button class.
System::Windows::Forms::CreateParams^ cp = __super::CreateParams;
// Update the button Style.
cp->Style |= 0x00000040; // BS_ICON value
return cp;
}
- SecurityPermission
for inheriting classes to call unmanaged code when getting the property value. Associated enumeration: SecurityPermissionFlag
. . :: . UnmanagedCode - SecurityPermission
for the immediate caller to call unmanaged code when getting the property value. Associated enumeration: SecurityPermissionFlag
. . :: . UnmanagedCode
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.