Partager via


CheckBox.CreateParams Propriété

Définition

Obtient les paramètres de création requis lorsque le handle de contrôle est créé.

protected:
 virtual property System::Windows::Forms::CreateParams ^ CreateParams { System::Windows::Forms::CreateParams ^ get(); };
protected override System.Windows.Forms.CreateParams CreateParams { get; }
member this.CreateParams : System.Windows.Forms.CreateParams
Protected Overrides ReadOnly Property CreateParams As CreateParams

Valeur de propriété

Qui CreateParams contient les paramètres de création requis lorsque le handle vers le contrôle est créé.

Exemples

L’exemple de code suivant étend la CreateParams propriété d’une Button classe dérivée. La CreateParams.Style propriété est modifiée, ce qui entraîne l’affichage d’un Icon bouton plutôt qu’un Image. Cet exemple nécessite que vous ayez une classe qui hérite de la Button classe.

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;
}
protected override CreateParams CreateParams
{
    get
    {
        // Extend the CreateParams property of the Button class.
        CreateParams cp = base.CreateParams;
        // Update the button Style.
        cp.Style |= 0x00000040; // BS_ICON value

        return cp;
    }
}

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

S’applique à