CheckBox.CreateParams Propriedade

Definição

Obtém os parâmetros de criação necessários quando a alça de controle é criada.

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

Valor da propriedade

CreateParams

Um CreateParams que contém os parâmetros de criação necessários quando a alça de controle é criada.

Exemplos

O exemplo de código a seguir estende a CreateParams propriedade de uma Button classe derivada. A CreateParams.Style propriedade é alterada, o que faz com que o botão exiba um Icon em vez de um Image. Este exemplo requer que você tenha uma classe que herda da 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

Aplica-se a