Condividi tramite


CheckBox.CreateParams Proprietà

Definizione

Ottiene i parametri di creazione necessari quando viene creato l'handle di controllo.

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

Valore della proprietà

Oggetto CreateParams che contiene i parametri di creazione necessari quando viene creato l'handle per il controllo.

Esempio

Nell'esempio di codice seguente viene estesa la CreateParams proprietà di una Button classe derivata. La CreateParams.Style proprietà viene modificata, che fa sì che il pulsante visualizzi un oggetto Icon anziché un oggetto Image. In questo esempio è necessario disporre di una classe che eredita dalla 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

Si applica a