CheckBox.CreateParams Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan parameter pembuatan yang diperlukan saat handel kontrol dibuat.
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
Nilai Properti
CreateParams yang berisi parameter pembuatan yang diperlukan saat handel ke kontrol dibuat.
Contoh
Contoh kode berikut memperluas CreateParams properti kelas turunan Button . Properti CreateParams.Style diubah, yang menyebabkan tombol menampilkan Icon bukan Image. Contoh ini mengharuskan Anda memiliki kelas yang mewarisi dari Button kelas .
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